diff options
Diffstat (limited to 'jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm')
28 files changed, 0 insertions, 2792 deletions
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/AbstractEclipseLinkEntityMappingsDetailsPage.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/AbstractEclipseLinkEntityMappingsDetailsPage.java deleted file mode 100644 index 9ce01d0a02..0000000000 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/AbstractEclipseLinkEntityMappingsDetailsPage.java +++ /dev/null @@ -1,132 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2008, 2010 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm; - -import org.eclipse.jpt.common.ui.WidgetFactory; -import org.eclipse.jpt.common.ui.internal.widgets.EnumFormComboViewer; -import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter; -import org.eclipse.jpt.common.utility.model.value.PropertyValueModel; -import org.eclipse.jpt.jpa.core.context.orm.EntityMappings; -import org.eclipse.jpt.jpa.eclipselink.core.context.orm.EclipseLinkEntityMappings; -import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkConverterContainer; -import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkUiDetailsMessages; -import org.eclipse.jpt.jpa.ui.internal.details.db.CatalogCombo; -import org.eclipse.jpt.jpa.ui.internal.details.db.SchemaCombo; -import org.eclipse.jpt.jpa.ui.internal.details.orm.AbstractEntityMappingsDetailsPage; -import org.eclipse.jpt.jpa.ui.internal.details.orm.EntityMappingsGeneratorsComposite; -import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmPackageChooser; -import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmQueriesComposite; -import org.eclipse.jpt.jpa.ui.internal.details.orm.PersistenceUnitMetadataComposite; -import org.eclipse.swt.widgets.Composite; - -/** - * Here the layout of this pane: - * <pre> - * ----------------------------------------------------------------------------- - * | ------------------------------------------------------------------------- | - * | | | | - * | | XmlPackageChooser | | - * | | | | - * | ------------------------------------------------------------------------- | - * | ------------------------------------------------------------ | - * | Schema: | SchemaCombo | | - * | ------------------------------------------------------------ | - * | ------------------------------------------------------------ | - * | Catalog: | CatalogCombo | | - * | ------------------------------------------------------------ | - * | ------------------------------------------------------------ | - * | Access Type: | |v| | - * | ------------------------------------------------------------ | - * | | - * | ------------------------------------------------------------------------- | - * | | | | - * | | PersistenceUnitMetadataComposite | | - * | | | | - * | ------------------------------------------------------------------------- | - * | ------------------------------------------------------------------------- | - * | | | | - * | | OrmGeneratorsComposite | | - * | | | | - * | ------------------------------------------------------------------------- | - * | ------------------------------------------------------------------------- | - * | | | | - * | | OrmQueriesComposite | | - * | | | | - * | ------------------------------------------------------------------------- | - * | ------------------------------------------------------------------------- | - * | | | | - * | | ConvertersComposite | | - * | | | | - * | ------------------------------------------------------------------------- | - * -----------------------------------------------------------------------------</pre> - * - * @see EntityMappings - * @see AbstractEclipseLinkEntityMappingsDetailsPage - The parent container - * @see CatalogCombo - * @see EnumFormComboViewer - * @see EntityMappingsGeneratorsComposite - * @see OrmPackageChooser - * @see OrmQueriesComposite - * @see PersistenceUnitMetadataComposite - * @see SchemaCombo - * - * @version 2.3 - * @since 2.1 - */ -public abstract class AbstractEclipseLinkEntityMappingsDetailsPage extends AbstractEntityMappingsDetailsPage -{ - /** - * Creates a new <code>EclipseLinkEntityMappingsDetailsPage</code>. - * - * @param parent The parent container - * @param widgetFactory The factory used to create various common widgets - */ - protected AbstractEclipseLinkEntityMappingsDetailsPage(Composite parent, - WidgetFactory widgetFactory) { - - super(parent, widgetFactory); - } - - @Override - protected void initializeLayout(Composite container) { - this.initializeEntityMappingsCollapsibleSection(container); - this.initializePersistenceUnitMetadataCollapsibleSection(container); - this.initializeGeneratorsCollapsibleSection(container); - this.initializeQueriesCollapsibleSection(container); - this.initializeConvertersCollapsibleSection(container); - } - - protected void initializeConvertersCollapsibleSection(Composite container) { - container = addCollapsibleSection( - container, - EclipseLinkUiDetailsMessages.EclipseLinkTypeMappingComposite_converters - ); - - this.initializeConvertersSection(container); - } - - protected void initializeConvertersSection(Composite container) { - new OrmEclipseLinkConvertersComposite( - this, - this.buildConverterHolder(), - container - ); - } - - private PropertyValueModel<OrmEclipseLinkConverterContainer> buildConverterHolder() { - return new PropertyAspectAdapter<EntityMappings, OrmEclipseLinkConverterContainer>(getSubjectHolder()) { - @Override - protected OrmEclipseLinkConverterContainer buildValue_() { - return ((EclipseLinkEntityMappings) this.subject).getConverterContainer(); - } - }; - } - -}
\ No newline at end of file diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/AbstractOrmEclipseLinkEntityComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/AbstractOrmEclipseLinkEntityComposite.java deleted file mode 100644 index 3614181cb9..0000000000 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/AbstractOrmEclipseLinkEntityComposite.java +++ /dev/null @@ -1,91 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2008, 2010 Oracle. - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Oracle - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm; - -import org.eclipse.jpt.common.ui.WidgetFactory; -import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter; -import org.eclipse.jpt.common.utility.model.value.PropertyValueModel; -import org.eclipse.jpt.jpa.core.context.orm.OrmEntity; -import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkCaching; -import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkConverterContainer; -import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkEntity; -import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkEntityAdvancedComposite; -import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkUiDetailsMessages; -import org.eclipse.jpt.jpa.ui.internal.details.orm.AbstractOrmEntityComposite; -import org.eclipse.swt.widgets.Composite; - -public abstract class AbstractOrmEclipseLinkEntityComposite extends AbstractOrmEntityComposite -{ - protected AbstractOrmEclipseLinkEntityComposite( - PropertyValueModel<? extends OrmEntity> subjectHolder, - Composite parent, WidgetFactory widgetFactory) { - super(subjectHolder, parent, widgetFactory); - } - - - @Override - protected void initializeLayout(Composite container) { - this.initializeEntityCollapsibleSection(container); - this.initializeCachingCollapsibleSectionPane(container); - this.initializeQueriesCollapsibleSection(container); - this.initializeInheritanceCollapsibleSection(container); - this.initializeAttributeOverridesCollapsibleSection(container); - this.initializeGeneratorsCollapsibleSection(container); - this.initializeConvertersCollapsibleSection(container); - this.initializeSecondaryTablesCollapsibleSection(container); - this.initializeAdvancedCollapsibleSection(container); - } - - protected void initializeCachingCollapsibleSectionPane(Composite container) { - container = addCollapsibleSection( - container, - EclipseLinkUiDetailsMessages.EclipseLinkTypeMappingComposite_caching); - initializeCachingSection(container, buildCachingHolder()); - } - - protected void initializeCachingSection(Composite container, PropertyValueModel<OrmEclipseLinkCaching> cachingHolder) { - new OrmEclipseLinkCachingComposite(this, cachingHolder, container); - } - - - private PropertyAspectAdapter<OrmEntity, OrmEclipseLinkCaching> buildCachingHolder() { - return new PropertyAspectAdapter<OrmEntity, OrmEclipseLinkCaching>(getSubjectHolder()) { - @Override - protected OrmEclipseLinkCaching buildValue_() { - return ((OrmEclipseLinkEntity) this.subject).getCaching(); - } - }; - } - - protected void initializeConvertersCollapsibleSection(Composite container) { - container = addCollapsibleSection( - container, - EclipseLinkUiDetailsMessages.EclipseLinkTypeMappingComposite_converters); - this.initializeConvertersSection(container, buildConverterContainerModel()); - } - - protected void initializeConvertersSection(Composite container, PropertyValueModel<OrmEclipseLinkConverterContainer> converterHolder) { - new OrmEclipseLinkConvertersComposite(this, converterHolder, container); - } - - private PropertyValueModel<OrmEclipseLinkConverterContainer> buildConverterContainerModel() { - return new PropertyAspectAdapter<OrmEntity, OrmEclipseLinkConverterContainer>(getSubjectHolder()) { - @Override - protected OrmEclipseLinkConverterContainer buildValue_() { - return ((OrmEclipseLinkEntity) this.subject).getConverterContainer(); - } - }; - } - - protected void initializeAdvancedCollapsibleSection(Composite container) { - new EclipseLinkEntityAdvancedComposite(this, container); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/AbstractOrmEclipseLinkMappedSuperclassComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/AbstractOrmEclipseLinkMappedSuperclassComposite.java deleted file mode 100644 index 49abc831c9..0000000000 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/AbstractOrmEclipseLinkMappedSuperclassComposite.java +++ /dev/null @@ -1,109 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2008, 2010 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm; - -import org.eclipse.jpt.common.ui.WidgetFactory; -import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter; -import org.eclipse.jpt.common.utility.model.value.PropertyValueModel; -import org.eclipse.jpt.jpa.core.context.AccessHolder; -import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkCaching; -import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkConverterContainer; -import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkMappedSuperclass; -import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkMappedSuperclassAdvancedComposite; -import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkUiDetailsMessages; -import org.eclipse.jpt.jpa.ui.details.JpaComposite; -import org.eclipse.jpt.jpa.ui.internal.details.AbstractMappedSuperclassComposite; -import org.eclipse.jpt.jpa.ui.internal.details.AccessTypeComposite; -import org.eclipse.jpt.jpa.ui.internal.details.IdClassComposite; -import org.eclipse.jpt.jpa.ui.internal.details.orm.MetadataCompleteComposite; -import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmJavaClassChooser; -import org.eclipse.swt.widgets.Composite; - -public abstract class AbstractOrmEclipseLinkMappedSuperclassComposite<T extends OrmEclipseLinkMappedSuperclass> - extends AbstractMappedSuperclassComposite<T> - implements JpaComposite -{ - protected AbstractOrmEclipseLinkMappedSuperclassComposite( - PropertyValueModel<? extends T> subjectHolder, - Composite parent, WidgetFactory widgetFactory) { - - super(subjectHolder, parent, widgetFactory); - } - - - @Override - protected void initializeLayout(Composite container) { - this.initializeMappedSuperclassCollapsibleSection(container); - this.initializeCachingCollapsibleSection(container); - this.initializeConvertersCollapsibleSection(container); - this.initializeAdvancedCollapsibleSection(container); - } - - @Override - protected void initializeMappedSuperclassSection(Composite container) { - new OrmJavaClassChooser(this, getSubjectHolder(), container); - new AccessTypeComposite(this, buildAccessHolder(), container); - new IdClassComposite(this, buildIdClassReferenceHolder(), container); - new MetadataCompleteComposite(this, getSubjectHolder(), container); - } - - protected void initializeCachingCollapsibleSection(Composite container) { - container = addCollapsibleSection( - container, - EclipseLinkUiDetailsMessages.EclipseLinkTypeMappingComposite_caching); - this.initializeCachingSection(container, buildCachingHolder()); - } - - protected void initializeCachingSection(Composite container, PropertyValueModel<OrmEclipseLinkCaching> cachingHolder) { - new OrmEclipseLinkCachingComposite(this, cachingHolder, container); - } - - protected PropertyValueModel<AccessHolder> buildAccessHolder() { - return new PropertyAspectAdapter<T, AccessHolder>(getSubjectHolder()) { - @Override - protected AccessHolder buildValue_() { - return this.subject.getPersistentType(); - } - }; - } - - private PropertyAspectAdapter<T, OrmEclipseLinkCaching> buildCachingHolder() { - return new PropertyAspectAdapter<T, OrmEclipseLinkCaching>(getSubjectHolder()) { - @Override - protected OrmEclipseLinkCaching buildValue_() { - return this.subject.getCaching(); - } - }; - } - - protected void initializeConvertersCollapsibleSection(Composite container) { - container = addCollapsibleSection( - container, - EclipseLinkUiDetailsMessages.EclipseLinkTypeMappingComposite_converters); - this.initializeConvertersSection(container, buildConverterContainerModel()); - } - - protected void initializeConvertersSection(Composite container, PropertyValueModel<OrmEclipseLinkConverterContainer> converterHolder) { - new OrmEclipseLinkConvertersComposite(this, converterHolder, container); - } - - private PropertyValueModel<OrmEclipseLinkConverterContainer> buildConverterContainerModel() { - return new PropertyAspectAdapter<T, OrmEclipseLinkConverterContainer>(getSubjectHolder()) { - @Override - protected OrmEclipseLinkConverterContainer buildValue_() { - return this.subject.getConverterContainer(); - } - }; - } - - protected void initializeAdvancedCollapsibleSection(Composite container) { - new EclipseLinkMappedSuperclassAdvancedComposite(this, container); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/BaseEclipseLinkOrmXmlUiFactory.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/BaseEclipseLinkOrmXmlUiFactory.java deleted file mode 100644 index 3ee93835c8..0000000000 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/BaseEclipseLinkOrmXmlUiFactory.java +++ /dev/null @@ -1,126 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm; - -import org.eclipse.jpt.common.ui.WidgetFactory; -import org.eclipse.jpt.common.utility.model.value.PropertyValueModel; -import org.eclipse.jpt.jpa.core.context.orm.OrmBasicMapping; -import org.eclipse.jpt.jpa.core.context.orm.OrmEmbeddable; -import org.eclipse.jpt.jpa.core.context.orm.OrmEntity; -import org.eclipse.jpt.jpa.core.context.orm.OrmIdMapping; -import org.eclipse.jpt.jpa.core.context.orm.OrmManyToManyMapping; -import org.eclipse.jpt.jpa.core.context.orm.OrmManyToOneMapping; -import org.eclipse.jpt.jpa.core.context.orm.OrmMappedSuperclass; -import org.eclipse.jpt.jpa.core.context.orm.OrmOneToManyMapping; -import org.eclipse.jpt.jpa.core.context.orm.OrmOneToOneMapping; -import org.eclipse.jpt.jpa.core.context.orm.OrmTransientMapping; -import org.eclipse.jpt.jpa.core.context.orm.OrmVersionMapping; -import org.eclipse.jpt.jpa.ui.details.JpaComposite; -import org.eclipse.jpt.jpa.ui.internal.details.TransientMappingComposite; -import org.eclipse.jpt.jpa.ui.internal.details.orm.BaseOrmXmlUiFactory; -import org.eclipse.swt.widgets.Composite; - -public abstract class BaseEclipseLinkOrmXmlUiFactory extends BaseOrmXmlUiFactory -{ - // **************** orm type mapping composites **************************** - - @Override - @SuppressWarnings("unchecked") - public JpaComposite createOrmMappedSuperclassComposite( - PropertyValueModel<OrmMappedSuperclass> subjectHolder, - Composite parent, - WidgetFactory widgetFactory) { - return new OrmEclipseLinkMappedSuperclassComposite(subjectHolder, parent, widgetFactory); - } - - @Override - public JpaComposite createOrmEntityComposite( - PropertyValueModel<OrmEntity> subjectHolder, - Composite parent, - WidgetFactory widgetFactory) { - return new OrmEclipseLinkEntityComposite(subjectHolder, parent, widgetFactory); - } - - @Override - @SuppressWarnings("unchecked") - public JpaComposite createOrmEmbeddableComposite( - PropertyValueModel<OrmEmbeddable> subjectHolder, - Composite parent, - WidgetFactory widgetFactory) { - return new OrmEclipseLinkEmbeddableComposite(subjectHolder, parent, widgetFactory); - } - - - // **************** orm attribute mapping composites *********************** - - @Override - public JpaComposite createOrmIdMappingComposite( - PropertyValueModel<OrmIdMapping> subjectHolder, - Composite parent, - WidgetFactory widgetFactory) { - return new OrmEclipseLinkIdMappingComposite(subjectHolder, parent, widgetFactory); - } - - @Override - public JpaComposite createOrmBasicMappingComposite( - PropertyValueModel<OrmBasicMapping> subjectHolder, - Composite parent, - WidgetFactory widgetFactory) { - return new OrmEclipseLinkBasicMappingComposite(subjectHolder, parent, widgetFactory); - } - - @Override - public JpaComposite createOrmVersionMappingComposite( - PropertyValueModel<OrmVersionMapping> subjectHolder, - Composite parent, - WidgetFactory widgetFactory) { - return new OrmEclipseLinkVersionMappingComposite(subjectHolder, parent, widgetFactory); - } - - @Override - public JpaComposite createOrmManyToOneMappingComposite( - PropertyValueModel<OrmManyToOneMapping> subjectHolder, - Composite parent, - WidgetFactory widgetFactory) { - return new OrmEclipseLinkManyToOneMappingComposite(subjectHolder, parent, widgetFactory); - } - - @Override - public JpaComposite createOrmOneToManyMappingComposite( - PropertyValueModel<OrmOneToManyMapping> subjectHolder, - Composite parent, - WidgetFactory widgetFactory) { - return new OrmEclipseLinkOneToManyMappingComposite(subjectHolder, parent, widgetFactory); - } - - @Override - public JpaComposite createOrmOneToOneMappingComposite( - PropertyValueModel<OrmOneToOneMapping> subjectHolder, - Composite parent, - WidgetFactory widgetFactory) { - return new OrmEclipseLinkOneToOneMappingComposite(subjectHolder, parent, widgetFactory); - } - - @Override - public JpaComposite createOrmManyToManyMappingComposite( - PropertyValueModel<OrmManyToManyMapping> subjectHolder, - Composite parent, - WidgetFactory widgetFactory) { - return new OrmEclipseLinkManyToManyMappingComposite(subjectHolder, parent, widgetFactory); - } - - @Override - public JpaComposite createOrmTransientMappingComposite( - PropertyValueModel<OrmTransientMapping> subjectHolder, - Composite parent, - WidgetFactory widgetFactory) { - return new TransientMappingComposite(subjectHolder, parent, widgetFactory); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkConverterDialog.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkConverterDialog.java deleted file mode 100644 index 7ae914c8e7..0000000000 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkConverterDialog.java +++ /dev/null @@ -1,192 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2008, 2011 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm; - -import org.eclipse.jpt.common.ui.internal.widgets.DialogPane; -import org.eclipse.jpt.common.ui.internal.widgets.ValidatingDialog; -import org.eclipse.jpt.common.utility.internal.StringConverter; -import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter; -import org.eclipse.jpt.common.utility.internal.model.value.StaticListValueModel; -import org.eclipse.jpt.common.utility.model.value.ListValueModel; -import org.eclipse.jpt.common.utility.model.value.WritablePropertyValueModel; -import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConverter; -import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCustomConverter; -import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkObjectTypeConverter; -import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkStructConverter; -import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkTypeConverter; -import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.EclipseLinkPersistenceUnit; -import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkUiDetailsMessages; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.swt.widgets.Text; - -public class EclipseLinkConverterDialog - extends ValidatingDialog<EclipseLinkConverterStateObject> -{ - /** - * The associated persistence unit - */ - EclipseLinkPersistenceUnit pUnit; - - // ********** constructors ********** - - /** - * Use this constructor to edit an existing conversion value - */ - public EclipseLinkConverterDialog(Shell parent, EclipseLinkPersistenceUnit pUnit) { - super(parent); - this.pUnit = pUnit; - } - - @Override - protected EclipseLinkConverterStateObject buildStateObject() { - return new EclipseLinkConverterStateObject(pUnit); - } - - // ********** open ********** - - @Override - protected void configureShell(Shell shell) { - super.configureShell(shell); - shell.setText(this.getTitle()); - } - - @Override - protected String getTitle() { - return EclipseLinkUiDetailsMessages.EclipseLinkConverterDialog_addConverter; - } - - @Override - protected String getDescriptionTitle() { - return EclipseLinkUiDetailsMessages.EclipseLinkConverterDialog_addConverterDescriptionTitle; - } - - @Override - protected String getDescription() { - return EclipseLinkUiDetailsMessages.EclipseLinkConverterDialog_addConverterDescription; - } - - @Override - protected DialogPane<EclipseLinkConverterStateObject> buildLayout(Composite container) { - return new ConversionValueDialogPane(container); - } - - @Override - public void create() { - super.create(); - - ConversionValueDialogPane pane = (ConversionValueDialogPane) getPane(); - pane.selectAll(); - - getButton(OK).setEnabled(false); - } - - - // ********** public API ********** - - /** - * Return the data value set in the text widget. - */ - public String getName() { - return getSubject().getName(); - } - - /** - * Return the object value set in the text widget. - */ - public Class<? extends EclipseLinkConverter> getConverterType() { - return getSubject().getConverterType(); - } - - private class ConversionValueDialogPane extends DialogPane<EclipseLinkConverterStateObject> { - - private Text nameText; - - ConversionValueDialogPane(Composite parent) { - super(EclipseLinkConverterDialog.this.getSubjectHolder(), parent); - } - - @Override - protected void initializeLayout(Composite container) { - this.nameText = addLabeledText( - container, - EclipseLinkUiDetailsMessages.EclipseLinkConverterDialog_name, - buildNameHolder() - ); - - addLabeledCombo( - container, - EclipseLinkUiDetailsMessages.EclipseLinkConverterDialog_converterType, - buildConverterTypeListHolder(), - buildConverterTypeHolder(), - buildStringConverter(), - null); - } - - protected ListValueModel<Class<? extends EclipseLinkConverter>> buildConverterTypeListHolder() { - return new StaticListValueModel<Class<? extends EclipseLinkConverter>>(EclipseLinkConverter.TYPES); - } - - private StringConverter<Class<? extends EclipseLinkConverter>> buildStringConverter() { - return new StringConverter<Class<? extends EclipseLinkConverter>>() { - public String convertToString(Class<? extends EclipseLinkConverter> value) { - if (value == null) { - return null; - } - if (value == EclipseLinkCustomConverter.class) { - return EclipseLinkUiDetailsMessages.EclipseLinkConvertersComposite_customConverter; - } - if (value == EclipseLinkObjectTypeConverter.class) { - return EclipseLinkUiDetailsMessages.EclipseLinkConvertersComposite_objectTypeConverter; - } - if (value == EclipseLinkStructConverter.class) { - return EclipseLinkUiDetailsMessages.EclipseLinkConvertersComposite_structConverter; - } - if (value == EclipseLinkTypeConverter.class) { - return EclipseLinkUiDetailsMessages.EclipseLinkConvertersComposite_typeConverter; - } - return value.getSimpleName(); - } - }; - } - - private WritablePropertyValueModel<String> buildNameHolder() { - return new PropertyAspectAdapter<EclipseLinkConverterStateObject, String>(getSubjectHolder(), EclipseLinkConverterStateObject.NAME_PROPERTY) { - @Override - protected String buildValue_() { - return this.subject.getName(); - } - - @Override - protected void setValue_(String value) { - this.subject.setName(value); - } - }; - } - - private WritablePropertyValueModel<Class<? extends EclipseLinkConverter>> buildConverterTypeHolder() { - return new PropertyAspectAdapter<EclipseLinkConverterStateObject, Class<? extends EclipseLinkConverter>>(getSubjectHolder(), EclipseLinkConverterStateObject.CONVERTER_TYPE_PROPERTY) { - @Override - protected Class<? extends EclipseLinkConverter> buildValue_() { - return this.subject.getConverterType(); - } - - @Override - protected void setValue_(Class<? extends EclipseLinkConverter> value) { - this.subject.setConverterType(value); - } - }; - } - - void selectAll() { - this.nameText.selectAll(); - } - } -} diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkConverterStateObject.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkConverterStateObject.java deleted file mode 100644 index 125f4c8fa4..0000000000 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkConverterStateObject.java +++ /dev/null @@ -1,140 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2008, 2011 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm; - -import java.util.ArrayList; -import java.util.List; -import java.util.ListIterator; -import org.eclipse.jface.dialogs.IMessageProvider; -import org.eclipse.jpt.common.utility.internal.StringTools; -import org.eclipse.jpt.common.utility.internal.node.AbstractNode; -import org.eclipse.jpt.common.utility.internal.node.Node; -import org.eclipse.jpt.common.utility.internal.node.Problem; -import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConverter; -import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.EclipseLinkPersistenceUnit; -import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkUiDetailsMessages; - -/** - * This is the state object used by the <code>EclipseLinkConverterDialog</code>, which stores - * the current name and validates it when it is modified. - * - * @see EclipseLinkConverterDialog - * - * @version 2.1 - * @since 2.1 - */ -final class EclipseLinkConverterStateObject extends AbstractNode -{ - /** - * The initial name or <code>null</code> - */ - private String name; - - /** - * The initial converterType or <code>null</code> - */ - private Class<? extends EclipseLinkConverter> converterType; - - /** - * The <code>Validator</code> used to validate this state object. - */ - private Validator validator; - - /** - * The associated persistence unit - */ - private EclipseLinkPersistenceUnit pUnit; - - /** - * Notifies a change in the data value property. - */ - static final String NAME_PROPERTY = "name"; //$NON-NLS-1$ - - /** - * Notifies a change in the object value property. - */ - static final String CONVERTER_TYPE_PROPERTY = "converterType"; //$NON-NLS-1$ - - - EclipseLinkConverterStateObject(EclipseLinkPersistenceUnit pUnit) { - super(null); - this.pUnit = pUnit; - } - - private void addNameProblemsTo(List<Problem> currentProblems) { - if (StringTools.stringIsEmpty(this.name)) { - currentProblems.add(buildProblem(EclipseLinkUiDetailsMessages.EclipseLinkConverterStateObject_nameMustBeSpecified, IMessageProvider.ERROR)); - } - else if (names().contains(this.name)) { - currentProblems.add(buildProblem(EclipseLinkUiDetailsMessages.EclipseLinkConverterStateObject_nameExists, IMessageProvider.WARNING)); - } - } - - private void addConverterTypeProblemsTo(List<Problem> currentProblems) { - if (this.converterType == null) { - currentProblems.add(buildProblem(EclipseLinkUiDetailsMessages.EclipseLinkConverterStateObject_typeMustBeSpecified, IMessageProvider.ERROR)); - } - } - - @Override - protected void addProblemsTo(List<Problem> currentProblems) { - super.addProblemsTo(currentProblems); - addNameProblemsTo(currentProblems); - addConverterTypeProblemsTo(currentProblems); - } - - private List<String> names() { - List<String> names = new ArrayList<String>(); - for (ListIterator<EclipseLinkConverter> converters = this.pUnit.allConverters(); converters.hasNext();){ - String name = converters.next().getName(); - names.add(name); - } - return names ; - } - - @Override - protected void checkParent(Node parentNode) { - //no parent - } - - public String displayString() { - return null; - } - - String getName() { - return this.name; - } - - Class<? extends EclipseLinkConverter> getConverterType() { - return this.converterType; - } - - public void setName(String newName) { - String oldName = this.name; - this.name = newName; - firePropertyChanged(NAME_PROPERTY, oldName, newName); - } - - public void setConverterType(Class<? extends EclipseLinkConverter> newConverterType) { - Class<? extends EclipseLinkConverter> oldConverterType = this.converterType; - this.converterType = newConverterType; - firePropertyChanged(CONVERTER_TYPE_PROPERTY, oldConverterType, newConverterType); - } - - @Override - public void setValidator(Validator validator) { - this.validator = validator; - } - - @Override - public Validator getValidator() { - return this.validator; - } -} diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkEntityMappingsDetailsPage.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkEntityMappingsDetailsPage.java deleted file mode 100644 index 3939440cff..0000000000 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkEntityMappingsDetailsPage.java +++ /dev/null @@ -1,91 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2008, 2009 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm; - -import org.eclipse.jpt.common.ui.WidgetFactory; -import org.eclipse.jpt.common.ui.internal.widgets.EnumFormComboViewer; -import org.eclipse.jpt.jpa.core.context.orm.EntityMappings; -import org.eclipse.jpt.jpa.ui.internal.details.db.CatalogCombo; -import org.eclipse.jpt.jpa.ui.internal.details.db.SchemaCombo; -import org.eclipse.jpt.jpa.ui.internal.details.orm.EntityMappingsGeneratorsComposite; -import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmPackageChooser; -import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmQueriesComposite; -import org.eclipse.jpt.jpa.ui.internal.details.orm.PersistenceUnitMetadataComposite; -import org.eclipse.swt.widgets.Composite; - -/** - * Here the layout of this pane: - * <pre> - * ----------------------------------------------------------------------------- - * | ------------------------------------------------------------------------- | - * | | | | - * | | XmlPackageChooser | | - * | | | | - * | ------------------------------------------------------------------------- | - * | ------------------------------------------------------------ | - * | Schema: | SchemaCombo | | - * | ------------------------------------------------------------ | - * | ------------------------------------------------------------ | - * | Catalog: | CatalogCombo | | - * | ------------------------------------------------------------ | - * | ------------------------------------------------------------ | - * | Access Type: | |v| | - * | ------------------------------------------------------------ | - * | | - * | ------------------------------------------------------------------------- | - * | | | | - * | | PersistenceUnitMetadataComposite | | - * | | | | - * | ------------------------------------------------------------------------- | - * | ------------------------------------------------------------------------- | - * | | | | - * | | OrmGeneratorsComposite | | - * | | | | - * | ------------------------------------------------------------------------- | - * | ------------------------------------------------------------------------- | - * | | | | - * | | OrmQueriesComposite | | - * | | | | - * | ------------------------------------------------------------------------- | - * | ------------------------------------------------------------------------- | - * | | | | - * | | ConvertersComposite | | - * | | | | - * | ------------------------------------------------------------------------- | - * -----------------------------------------------------------------------------</pre> - * - * @see EntityMappings - * @see EclipseLinkEntityMappingsDetailsPage - The parent container - * @see CatalogCombo - * @see EnumFormComboViewer - * @see EntityMappingsGeneratorsComposite - * @see OrmPackageChooser - * @see OrmQueriesComposite - * @see PersistenceUnitMetadataComposite - * @see SchemaCombo - * - * @version 2.2 - * @since 2.1 - */ -public class EclipseLinkEntityMappingsDetailsPage extends AbstractEclipseLinkEntityMappingsDetailsPage -{ - /** - * Creates a new <code>EclipseLinkEntityMappingsDetailsPage</code>. - * - * @param parent The parent container - * @param widgetFactory The factory used to create various common widgets - */ - public EclipseLinkEntityMappingsDetailsPage(Composite parent, - WidgetFactory widgetFactory) { - - super(parent, widgetFactory); - } - -}
\ No newline at end of file diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkEntityMappingsDetailsProvider.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkEntityMappingsDetailsProvider.java deleted file mode 100644 index 99f0bf3bff..0000000000 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkEntityMappingsDetailsProvider.java +++ /dev/null @@ -1,65 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2009, 2010 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm; - -import org.eclipse.jpt.common.core.JptResourceType; -import org.eclipse.jpt.common.ui.WidgetFactory; -import org.eclipse.jpt.jpa.core.JpaStructureNode; -import org.eclipse.jpt.jpa.eclipselink.core.JptJpaEclipseLinkCorePlugin; -import org.eclipse.jpt.jpa.ui.details.JpaDetailsPage; -import org.eclipse.jpt.jpa.ui.details.JpaDetailsProvider; -import org.eclipse.jpt.jpa.ui.internal.details.AbstractEntityMappingsDetailsProvider; -import org.eclipse.swt.widgets.Composite; - -/** - * 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.2 - * @since 2.2 - */ -public class EclipseLinkEntityMappingsDetailsProvider - extends AbstractEntityMappingsDetailsProvider -{ - // singleton - private static final JpaDetailsProvider INSTANCE = new EclipseLinkEntityMappingsDetailsProvider(); - - - /** - * Return the singleton - */ - public static JpaDetailsProvider instance() { - return INSTANCE; - } - - - /** - * Enforce singleton usage - */ - private EclipseLinkEntityMappingsDetailsProvider() { - super(); - } - - - @Override - protected boolean providesDetails(JptResourceType resourceType) { - return resourceType.equals(JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_1_0_RESOURCE_TYPE) - || resourceType.equals(JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_1_1_RESOURCE_TYPE) - || resourceType.equals(JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_1_2_RESOURCE_TYPE); - } - - public JpaDetailsPage<? extends JpaStructureNode> buildDetailsPage( - Composite parent, - WidgetFactory widgetFactory) { - - return new EclipseLinkEntityMappingsDetailsPage(parent, widgetFactory); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkOrmXmlUiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkOrmXmlUiDefinition.java deleted file mode 100644 index e22aa222dc..0000000000 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkOrmXmlUiDefinition.java +++ /dev/null @@ -1,103 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2009 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm; - -import java.util.List; -import org.eclipse.jpt.common.core.JptResourceType; -import org.eclipse.jpt.jpa.core.context.AttributeMapping; -import org.eclipse.jpt.jpa.core.context.TypeMapping; -import org.eclipse.jpt.jpa.eclipselink.core.JptJpaEclipseLinkCorePlugin; -import org.eclipse.jpt.jpa.eclipselink.ui.internal.structure.EclipseLinkOrmResourceModelStructureProvider; -import org.eclipse.jpt.jpa.ui.ResourceUiDefinition; -import org.eclipse.jpt.jpa.ui.details.orm.OrmAttributeMappingUiDefinition; -import org.eclipse.jpt.jpa.ui.details.orm.OrmTypeMappingUiDefinition; -import org.eclipse.jpt.jpa.ui.details.orm.OrmXmlUiFactory; -import org.eclipse.jpt.jpa.ui.internal.details.orm.AbstractOrmXmlResourceUiDefinition; -import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmBasicMappingUiDefinition; -import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmEmbeddableUiDefinition; -import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmEmbeddedIdMappingUiDefinition; -import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmEmbeddedMappingUiDefinition; -import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmEntityUiDefinition; -import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmIdMappingUiDefinition; -import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmManyToManyMappingUiDefinition; -import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmManyToOneMappingUiDefinition; -import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmMappedSuperclassUiDefinition; -import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmOneToManyMappingUiDefinition; -import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmOneToOneMappingUiDefinition; -import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmTransientMappingUiDefinition; -import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmVersionMappingUiDefinition; -import org.eclipse.jpt.jpa.ui.structure.JpaStructureProvider; - -public class EclipseLinkOrmXmlUiDefinition - extends AbstractOrmXmlResourceUiDefinition -{ - // singleton - private static final ResourceUiDefinition INSTANCE = new EclipseLinkOrmXmlUiDefinition(); - - - /** - * Return the singleton - */ - public static ResourceUiDefinition instance() { - return INSTANCE; - } - - - /** - * Enforce singleton usage - */ - private EclipseLinkOrmXmlUiDefinition() { - super(); - } - - - @Override - protected OrmXmlUiFactory buildOrmXmlUiFactory() { - return new EclipseLinkOrmXmlUiFactory(); - } - - public boolean providesUi(JptResourceType resourceType) { - return resourceType.equals(JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_1_0_RESOURCE_TYPE); - } - - public JpaStructureProvider getStructureProvider() { - return EclipseLinkOrmResourceModelStructureProvider.instance(); - } - - @Override - protected void addOrmAttributeMappingUiDefinitionsTo( - List<OrmAttributeMappingUiDefinition<? extends AttributeMapping>> definitions) { - - definitions.add(OrmIdMappingUiDefinition.instance()); - definitions.add(OrmEmbeddedIdMappingUiDefinition.instance()); - definitions.add(OrmBasicMappingUiDefinition.instance()); - definitions.add(OrmVersionMappingUiDefinition.instance()); - definitions.add(OrmManyToOneMappingUiDefinition.instance()); - definitions.add(OrmOneToManyMappingUiDefinition.instance()); - definitions.add(OrmOneToOneMappingUiDefinition.instance()); - definitions.add(OrmManyToManyMappingUiDefinition.instance()); - definitions.add(OrmEmbeddedMappingUiDefinition.instance()); - definitions.add(OrmTransientMappingUiDefinition.instance()); - - definitions.add(OrmEclipseLinkBasicCollectionMappingUiDefinition.instance()); - definitions.add(OrmEclipseLinkBasicMapMappingUiDefinition.instance()); - definitions.add(OrmEclipseLinkVariableOneToOneMappingUiDefinition.instance()); - definitions.add(OrmEclipseLinkTransformationMappingUiDefinition.instance()); - } - - @Override - protected void addOrmTypeMappingUiDefinitionsTo( - List<OrmTypeMappingUiDefinition<? extends TypeMapping>> definitions) { - - definitions.add(OrmEntityUiDefinition.instance()); - definitions.add(OrmMappedSuperclassUiDefinition.instance()); - definitions.add(OrmEmbeddableUiDefinition.instance()); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkOrmXmlUiFactory.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkOrmXmlUiFactory.java deleted file mode 100644 index 36e300c097..0000000000 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkOrmXmlUiFactory.java +++ /dev/null @@ -1,15 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2009 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm; - -public class EclipseLinkOrmXmlUiFactory extends BaseEclipseLinkOrmXmlUiFactory -{ - //nothing -} diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkBasicCollectionMappingUiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkBasicCollectionMappingUiDefinition.java deleted file mode 100644 index 20d7eb523b..0000000000 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkBasicCollectionMappingUiDefinition.java +++ /dev/null @@ -1,56 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2009, 2011 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm; - -import org.eclipse.jpt.common.ui.WidgetFactory; -import org.eclipse.jpt.common.utility.model.value.PropertyValueModel; -import org.eclipse.jpt.jpa.core.context.ReadOnlyPersistentAttribute; -import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkBasicCollectionMapping; -import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.AbstractEclipseLinkBasicCollectionMappingUiDefinition; -import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkBasicCollectionMappingComposite; -import org.eclipse.jpt.jpa.ui.details.JpaComposite; -import org.eclipse.jpt.jpa.ui.details.orm.OrmAttributeMappingUiDefinition; -import org.eclipse.jpt.jpa.ui.details.orm.OrmXmlUiFactory; -import org.eclipse.swt.widgets.Composite; - -public class OrmEclipseLinkBasicCollectionMappingUiDefinition - extends AbstractEclipseLinkBasicCollectionMappingUiDefinition<ReadOnlyPersistentAttribute, EclipseLinkBasicCollectionMapping> - implements OrmAttributeMappingUiDefinition<EclipseLinkBasicCollectionMapping> -{ - // singleton - private static final OrmEclipseLinkBasicCollectionMappingUiDefinition INSTANCE = - new OrmEclipseLinkBasicCollectionMappingUiDefinition(); - - - /** - * Return the singleton. - */ - public static OrmAttributeMappingUiDefinition<EclipseLinkBasicCollectionMapping> instance() { - return INSTANCE; - } - - - /** - * Ensure single instance. - */ - private OrmEclipseLinkBasicCollectionMappingUiDefinition() { - super(); - } - - - public JpaComposite buildAttributeMappingComposite( - OrmXmlUiFactory factory, - PropertyValueModel<EclipseLinkBasicCollectionMapping> subjectHolder, - Composite parent, - WidgetFactory widgetFactory) { - - return new EclipseLinkBasicCollectionMappingComposite(subjectHolder, parent, widgetFactory); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkBasicMapMappingUiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkBasicMapMappingUiDefinition.java deleted file mode 100644 index 901be5bfc9..0000000000 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkBasicMapMappingUiDefinition.java +++ /dev/null @@ -1,56 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2009, 2011 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm; - -import org.eclipse.jpt.common.ui.WidgetFactory; -import org.eclipse.jpt.common.utility.model.value.PropertyValueModel; -import org.eclipse.jpt.jpa.core.context.ReadOnlyPersistentAttribute; -import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkBasicMapMapping; -import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.AbstractEclipseLinkBasicMapMappingUiDefinition; -import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkBasicMapMappingComposite; -import org.eclipse.jpt.jpa.ui.details.JpaComposite; -import org.eclipse.jpt.jpa.ui.details.orm.OrmAttributeMappingUiDefinition; -import org.eclipse.jpt.jpa.ui.details.orm.OrmXmlUiFactory; -import org.eclipse.swt.widgets.Composite; - -public class OrmEclipseLinkBasicMapMappingUiDefinition - extends AbstractEclipseLinkBasicMapMappingUiDefinition<ReadOnlyPersistentAttribute, EclipseLinkBasicMapMapping> - implements OrmAttributeMappingUiDefinition<EclipseLinkBasicMapMapping> -{ - // singleton - private static final OrmEclipseLinkBasicMapMappingUiDefinition INSTANCE = - new OrmEclipseLinkBasicMapMappingUiDefinition(); - - - /** - * Return the singleton. - */ - public static OrmAttributeMappingUiDefinition<EclipseLinkBasicMapMapping> instance() { - return INSTANCE; - } - - - /** - * Ensure single instance. - */ - private OrmEclipseLinkBasicMapMappingUiDefinition() { - super(); - } - - - public JpaComposite buildAttributeMappingComposite( - OrmXmlUiFactory factory, - PropertyValueModel<EclipseLinkBasicMapMapping> subjectHolder, - Composite parent, - WidgetFactory widgetFactory) { - - return new EclipseLinkBasicMapMappingComposite(subjectHolder, parent, widgetFactory); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkBasicMappingComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkBasicMappingComposite.java deleted file mode 100644 index 27a25f7ba6..0000000000 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkBasicMappingComposite.java +++ /dev/null @@ -1,58 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2008, 2010 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm; - -import org.eclipse.jpt.common.ui.WidgetFactory; -import org.eclipse.jpt.common.ui.internal.widgets.Pane; -import org.eclipse.jpt.common.utility.model.value.PropertyValueModel; -import org.eclipse.jpt.jpa.core.context.BasicMapping; -import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConvert; -import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkBasicMappingComposite; -import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkMutableComposite; -import org.eclipse.jpt.jpa.ui.internal.details.ColumnComposite; -import org.eclipse.jpt.jpa.ui.internal.details.FetchTypeComposite; -import org.eclipse.jpt.jpa.ui.internal.details.OptionalComposite; -import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmMappingNameChooser; -import org.eclipse.swt.widgets.Composite; - -//Remove the Converters section from 1.0 orm basic mappings. -//This is supported in EclipseLink in version 1.1, but not 1.0 -public class OrmEclipseLinkBasicMappingComposite extends EclipseLinkBasicMappingComposite<BasicMapping> -{ - /** - * Creates a new <code>EclipseLinkOrmBasicMappingComposite</code>. - * - * @param subjectHolder The holder of the subject <code>BasicMapping</code> - * @param parent The parent container - * @param widgetFactory The factory used to create various common widgets - */ - public OrmEclipseLinkBasicMappingComposite(PropertyValueModel<? extends BasicMapping> subjectHolder, - Composite parent, - WidgetFactory widgetFactory) { - - super(subjectHolder, parent, widgetFactory); - } - - @Override - protected void initializeBasicSection(Composite container) { - new ColumnComposite(this, buildColumnHolder(), container); - new OrmMappingNameChooser(this, getSubjectHolder(), container); - new FetchTypeComposite(this, container); - new OptionalComposite(this, addSubPane(container, 4)); - new EclipseLinkMutableComposite(this, buildMutableHolder(), container); - } - - @Override - //everything but the 'Define Converter' section. This is not supported in eclipselink 1.0, but is in 1.1 - protected Pane<EclipseLinkConvert> buildConvertComposite(PropertyValueModel<EclipseLinkConvert> convertHolder, Composite container) { - return new OrmEclipseLinkConvert1_0Composite(convertHolder, container, getWidgetFactory()); - } - -}
\ No newline at end of file diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkCachingComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkCachingComposite.java deleted file mode 100644 index cf0dd25520..0000000000 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkCachingComposite.java +++ /dev/null @@ -1,68 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2008, 2010 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm; - -import org.eclipse.jpt.common.ui.internal.widgets.Pane; -import org.eclipse.jpt.common.utility.model.value.PropertyValueModel; -import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkCaching; -import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkAlwaysRefreshComposite; -import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkCacheSizeComposite; -import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkCacheTypeComposite; -import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkCachingComposite; -import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkDisableHitsComposite; -import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkRefreshOnlyIfNewerComposite; -import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.java.JavaEclipseLinkEntityComposite; -import org.eclipse.swt.widgets.Composite; - -/** - * This pane shows the caching options. - * <p> - * Here the layout of this pane: - * <pre> - * ----------------------------------------------------------------------------- - * | x Shared | - * | CacheTypeComposite | - * | CacheSizeComposite | - * | > Advanced | - * | ExpiryComposite | - * | AlwaysRefreshComposite | - * | RefreshOnlyIfNewerComposite | - * | DisableHitsComposite | - * | CacheCoordinationComposite | - * | ExistenceTypeComposite | - * -----------------------------------------------------------------------------</pre> - * - * @see Entity - * @see EclipseLinkCaching - * @see JavaEclipseLinkEntityComposite - The parent container - * @see EclipseLinkCacheTypeComposite - * @see EclipseLinkCacheSizeComposite - * @see EclipseLinkAlwaysRefreshComposite - * @see EclipseLinkRefreshOnlyIfNewerComposite - * @see EclipseLinkDisableHitsComposite - * - * @version 2.1 - * @since 2.1 - */ -public class OrmEclipseLinkCachingComposite extends EclipseLinkCachingComposite<OrmEclipseLinkCaching> -{ - - public OrmEclipseLinkCachingComposite(Pane<?> parentPane, - PropertyValueModel<OrmEclipseLinkCaching> subjectHolder, - Composite parent) { - - super(parentPane, subjectHolder, parent); - } - - @Override - protected void initializeExistenceCheckingComposite(Composite parent) { - new OrmEclipseLinkExistenceCheckingComposite(this, parent); - } -}
\ No newline at end of file diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkConvert1_0Composite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkConvert1_0Composite.java deleted file mode 100644 index fbfa820633..0000000000 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkConvert1_0Composite.java +++ /dev/null @@ -1,220 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2008, 2011 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm; - -import java.util.ArrayList; -import org.eclipse.jpt.common.ui.WidgetFactory; -import org.eclipse.jpt.common.ui.internal.JptCommonUiMessages; -import org.eclipse.jpt.common.ui.internal.util.PaneEnabler; -import org.eclipse.jpt.common.ui.internal.util.SWTUtil; -import org.eclipse.jpt.common.ui.internal.widgets.Pane; -import org.eclipse.jpt.common.utility.internal.StringConverter; -import org.eclipse.jpt.common.utility.internal.model.value.CollectionAspectAdapter; -import org.eclipse.jpt.common.utility.internal.model.value.CompositeListValueModel; -import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter; -import org.eclipse.jpt.common.utility.internal.model.value.PropertyListValueModelAdapter; -import org.eclipse.jpt.common.utility.internal.model.value.SortedListValueModelAdapter; -import org.eclipse.jpt.common.utility.internal.model.value.StaticListValueModel; -import org.eclipse.jpt.common.utility.internal.model.value.TransformationPropertyValueModel; -import org.eclipse.jpt.common.utility.model.value.CollectionValueModel; -import org.eclipse.jpt.common.utility.model.value.ListValueModel; -import org.eclipse.jpt.common.utility.model.value.PropertyValueModel; -import org.eclipse.jpt.common.utility.model.value.WritablePropertyValueModel; -import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConvert; -import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.EclipseLinkPersistenceUnit; -import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkBasicMappingComposite; -import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkUiDetailsMessages; -import org.eclipse.osgi.util.NLS; -import org.eclipse.swt.widgets.Combo; -import org.eclipse.swt.widgets.Composite; - -/** - * Here the layout of this pane: - * <pre> - * ----------------------------------------------------------------------------- - * | -------------------------------------------------------------- | - * | Converter: | |v| | - * | -------------------------------------------------------------- | - * -----------------------------------------------------------------------------</pre> - * - * @see EclipseLinkConvert - * @see EclipseLinkBasicMappingComposite - A container of this widget - * - * @version 2.1 - * @since 2.1 - */ - -//Removes the Define Converters section from orm basic, id, version mapping. -//This is supported in EclipseLink in version 1.1, but not 1.0 -public class OrmEclipseLinkConvert1_0Composite extends Pane<EclipseLinkConvert> -{ - - /** - * A key used to represent the default value, this is required to convert - * the selected item from a combo to <code>null</code>. This key is most - * likely never typed the user and it will help to convert the value to - * <code>null</code> when it's time to set the new selected value into the - * model. - */ - protected static String DEFAULT_KEY = "?!#!?#?#?default?#?!#?!#?"; //$NON-NLS-1$ - - - public OrmEclipseLinkConvert1_0Composite(PropertyValueModel<? extends EclipseLinkConvert> subjectHolder, - Composite parent, - WidgetFactory widgetFactory) { - - super(subjectHolder, parent, widgetFactory); - } - - @Override - protected void initializeLayout(Composite container) { - Combo combo = addLabeledEditableCombo( - container, - EclipseLinkUiDetailsMessages.EclipseLinkConvertComposite_converterNameLabel, - buildConvertNameListHolder(), - buildConvertNameHolder(), - buildNameConverter(), - null - ); - SWTUtil.attachDefaultValueHandler(combo); - - new PaneEnabler(buildBooleanHolder(), this); - } - - protected final WritablePropertyValueModel<String> buildConvertNameHolder() { - return new PropertyAspectAdapter<EclipseLinkConvert, String>(getSubjectHolder(), EclipseLinkConvert.SPECIFIED_CONVERTER_NAME_PROPERTY) { - @Override - protected String buildValue_() { - return this.subject.getSpecifiedConverterName(); - } - - @Override - protected void setValue_(String value) { - // Convert the default value or an empty string to null - if ((value != null) && - ((value.length() == 0) || value.startsWith(DEFAULT_KEY))) { - - value = null; - } - this.subject.setSpecifiedConverterName(value); - } - }; - } - private ListValueModel<String> buildConvertNameListHolder() { - java.util.List<ListValueModel<String>> list = new ArrayList<ListValueModel<String>>(); - list.add(buildDefaultNameListHolder()); - list.add(buildReservedConverterNameListHolder()); - list.add(buildSortedConverterNamesModel()); - return new CompositeListValueModel<ListValueModel<String>, String>(list); - } - - protected ListValueModel<String> buildDefaultNameListHolder() { - return new PropertyListValueModelAdapter<String>( - buildDefaultNameHolder() - ); - } - - private WritablePropertyValueModel<String> buildDefaultNameHolder() { - return new PropertyAspectAdapter<EclipseLinkConvert, String>(getSubjectHolder(), EclipseLinkConvert.DEFAULT_CONVERTER_NAME_PROPERTY) { - @Override - protected String buildValue_() { - String name = this.subject.getDefaultConverterName(); - - if (name == null) { - name = DEFAULT_KEY; - } - else { - name = DEFAULT_KEY + name; - } - - return name; - } - }; - } - - private StringConverter<String> buildNameConverter() { - return new StringConverter<String>() { - public String convertToString(String value) { - - if (getSubject() == null) { - return value; - } - - if (value == null) { - value = getSubject().getDefaultConverterName(); - - if (value != null) { - value = DEFAULT_KEY + value; - } - else { - value = DEFAULT_KEY; - } - } - - if (value.startsWith(DEFAULT_KEY)) { - String defaultName = value.substring(DEFAULT_KEY.length()); - - if (defaultName.length() > 0) { - value = NLS.bind( - JptCommonUiMessages.DefaultWithOneParam, - defaultName - ); - } - else { - value = JptCommonUiMessages.DefaultEmpty; - } - } - - return value; - } - }; - } - - protected ListValueModel<String> buildReservedConverterNameListHolder() { - return new StaticListValueModel<String>(EclipseLinkConvert.RESERVED_CONVERTER_NAMES); - } - - protected ListValueModel<String> buildSortedConverterNamesModel() { - return new SortedListValueModelAdapter<String>(this.buildConverterNamesModel()); - } - - protected CollectionValueModel<String> buildConverterNamesModel() { - return new CollectionAspectAdapter<EclipseLinkPersistenceUnit, String>( - buildPersistenceUnitHolder(), - EclipseLinkPersistenceUnit.CONVERTERS_COLLECTION)//TODO need EclipseLinkPersistenceUnit interface - { - @Override - protected Iterable<String> getIterable() { - return this.subject.getUniqueConverterNames(); - } - }; - } - - protected PropertyValueModel<EclipseLinkPersistenceUnit> buildPersistenceUnitHolder() { - return new PropertyAspectAdapter<EclipseLinkConvert, EclipseLinkPersistenceUnit>(getSubjectHolder()) { - @Override - protected EclipseLinkPersistenceUnit buildValue_() { - return (EclipseLinkPersistenceUnit) getSubject().getPersistenceUnit(); - } - }; - } - - protected PropertyValueModel<Boolean> buildBooleanHolder() { - return new TransformationPropertyValueModel<EclipseLinkConvert, Boolean>(getSubjectHolder()) { - @Override - protected Boolean transform(EclipseLinkConvert value) { - if (getSubject() != null && getSubject().getParent().getPersistentAttribute().isVirtual()) { - return Boolean.FALSE; - } - return Boolean.valueOf(value != null); - } - }; - } -} diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkConvertersComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkConvertersComposite.java deleted file mode 100644 index 3b1322a626..0000000000 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkConvertersComposite.java +++ /dev/null @@ -1,412 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2008, 2011 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm; - -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.jface.window.Window; -import org.eclipse.jpt.common.ui.internal.util.ControlSwitcher; -import org.eclipse.jpt.common.ui.internal.widgets.AddRemoveListPane; -import org.eclipse.jpt.common.ui.internal.widgets.AddRemovePane.Adapter; -import org.eclipse.jpt.common.ui.internal.widgets.Pane; -import org.eclipse.jpt.common.utility.internal.Transformer; -import org.eclipse.jpt.common.utility.internal.iterators.TransformationIterator; -import org.eclipse.jpt.common.utility.internal.model.value.CompositeListValueModel; -import org.eclipse.jpt.common.utility.internal.model.value.ItemPropertyListValueModelAdapter; -import org.eclipse.jpt.common.utility.internal.model.value.ListAspectAdapter; -import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel; -import org.eclipse.jpt.common.utility.internal.model.value.TransformationPropertyValueModel; -import org.eclipse.jpt.common.utility.internal.model.value.swing.ObjectListSelectionModel; -import org.eclipse.jpt.common.utility.model.value.ListValueModel; -import org.eclipse.jpt.common.utility.model.value.PropertyValueModel; -import org.eclipse.jpt.common.utility.model.value.WritablePropertyValueModel; -import org.eclipse.jpt.jpa.core.context.NamedNativeQuery; -import org.eclipse.jpt.jpa.core.context.NamedQuery; -import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConverter; -import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCustomConverter; -import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkObjectTypeConverter; -import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkStructConverter; -import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkTypeConverter; -import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkConverterContainer; -import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.EclipseLinkPersistenceUnit; -import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkCustomConverterComposite; -import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkObjectTypeConverterComposite; -import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkStructConverterComposite; -import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkTypeConverterComposite; -import org.eclipse.jpt.jpa.ui.internal.details.AbstractEntityComposite; -import org.eclipse.jpt.jpa.ui.internal.details.NamedNativeQueryPropertyComposite; -import org.eclipse.jpt.jpa.ui.internal.details.NamedQueryPropertyComposite; -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; - -/** - * This pane shows the list of named queries and named native queries. - * <p> - * Here the layout of this pane: - * <pre> - * ----------------------------------------------------------------------------- - * | ------------------------------------------------------------------------- | - * | | | | - * | | AddRemoveListPane | | - * | | | | - * | ------------------------------------------------------------------------- | - * | ------------------------------------------------------------------------- | - * | | | | - * | | ConverterComposite or ObjectTypeConverterComposite | | - * | | or StructConverterComposite or TypeConverterComposite | | - * | | | | - * | ------------------------------------------------------------------------- | - * -----------------------------------------------------------------------------</pre> - * - * @see Entity - * @see Query - * @see NamedNativeQuery - * @see NamedQuery - * @see AbstractEntityComposite - The parent container - * @see NamedNativeQueryPropertyComposite - * @see NamedQueryPropertyComposite - * - * @version 2.1 - * @since 2.1 - */ -public class OrmEclipseLinkConvertersComposite extends Pane<OrmEclipseLinkConverterContainer> -{ - private AddRemoveListPane<OrmEclipseLinkConverterContainer> listPane; - private EclipseLinkCustomConverterComposite converterComposite; - private EclipseLinkObjectTypeConverterComposite objectTypeConverterComposite; - private EclipseLinkStructConverterComposite structConverterComposite; - private EclipseLinkTypeConverterComposite typeConverterComposite; - private WritablePropertyValueModel<EclipseLinkConverter> selectedConverterHolder; - - public OrmEclipseLinkConvertersComposite( - Pane<?> parentPane, - PropertyValueModel<? extends OrmEclipseLinkConverterContainer> subjectHolder, - Composite parent) { - - super(parentPane, subjectHolder, parent, false); - } - - @Override - protected void initialize() { - super.initialize(); - this.selectedConverterHolder = buildSelectedConverterHolder(); - } - - private WritablePropertyValueModel<EclipseLinkConverter> buildSelectedConverterHolder() { - return new SimplePropertyValueModel<EclipseLinkConverter>(); - } - - @Override - protected void initializeLayout(Composite container) { - - // List pane - this.listPane = addListPane(container); - - // Property pane - PageBook pageBook = new PageBook(container, SWT.NULL); - pageBook.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - - this.converterComposite = new EclipseLinkCustomConverterComposite( - buildCustomConverterHolder(), - pageBook, - getWidgetFactory() - ); - registerSubPane(this.converterComposite); - - this.objectTypeConverterComposite = new EclipseLinkObjectTypeConverterComposite( - buildObjectTypeConverterHolder(), - pageBook, - getWidgetFactory() - ); - registerSubPane(this.objectTypeConverterComposite); - - this.structConverterComposite = new EclipseLinkStructConverterComposite( - buildStructConverterHolder(), - pageBook, - getWidgetFactory() - ); - registerSubPane(this.structConverterComposite); - - this.typeConverterComposite = new EclipseLinkTypeConverterComposite( - buildTypeConverterHolder(), - pageBook, - getWidgetFactory() - ); - registerSubPane(this.typeConverterComposite); - - installPaneSwitcher(pageBook); - } - - private AddRemoveListPane<OrmEclipseLinkConverterContainer> addListPane(Composite container) { - - return new AddRemoveListPane<OrmEclipseLinkConverterContainer>( - this, - container, - buildConvertersAdapter(), - buildDisplayableConvertersListHolder(), - this.selectedConverterHolder, - buildConvertersListLabelProvider(), - null//JpaHelpContextIds.MAPPING_NAMED_QUERIES - ) { - //TODO yeah, this is weird, but i don't want this to be disabled just - //because the subject is null. i have no need for that and that is - //currently how AddRemovePane works. See OrmQueriesComposite where - //the work around there is yet another pane enabler. I want to change - //how this works in 2.2 - @Override - public void enableWidgets(boolean enabled) { - super.enableWidgets(true); - } - }; - } - - private void installPaneSwitcher(PageBook pageBook) { - new ControlSwitcher(this.selectedConverterHolder, buildPaneTransformer(), pageBook); - } - - private Adapter buildConvertersAdapter() { - - return new AddRemoveListPane.AbstractAdapter() { - - public void addNewItem(ObjectListSelectionModel listSelectionModel) { - addConverter(); - } - - public void removeSelectedItems(ObjectListSelectionModel listSelectionModel) { - for (Object item : listSelectionModel.selectedValues()) { - if (((EclipseLinkConverter) item).getType() == EclipseLinkCustomConverter.class) { - getSubject().removeCustomConverter((EclipseLinkCustomConverter) item); - } - else if (((EclipseLinkConverter) item).getType() == EclipseLinkObjectTypeConverter.class) { - getSubject().removeObjectTypeConverter((EclipseLinkObjectTypeConverter) item); - } - else if (((EclipseLinkConverter) item).getType() == EclipseLinkStructConverter.class) { - getSubject().removeStructConverter((EclipseLinkStructConverter) item); - } - else if (((EclipseLinkConverter) item).getType() == EclipseLinkTypeConverter.class) { - getSubject().removeTypeConverter((EclipseLinkTypeConverter) item); - } - } - } - }; - } - - private void addConverter() { - addEclipseLinkConverterFromDialog(buildEclipseLinkConverterDialog()); - } - - protected EclipseLinkConverterDialog buildEclipseLinkConverterDialog() { - return new EclipseLinkConverterDialog(getShell(), (EclipseLinkPersistenceUnit)this.getSubject().getPersistenceUnit()); - } - - protected void addEclipseLinkConverterFromDialog(EclipseLinkConverterDialog dialog) { - if (dialog.open() != Window.OK) { - return; - } - Class<? extends EclipseLinkConverter> converterType = dialog.getConverterType(); - EclipseLinkConverter converter; - if (converterType == EclipseLinkCustomConverter.class) { - converter = this.getSubject().addCustomConverter(getSubject().customConvertersSize()); - } - else if (converterType == EclipseLinkObjectTypeConverter.class) { - converter = this.getSubject().addObjectTypeConverter(getSubject().objectTypeConvertersSize()); - } - else if (converterType == EclipseLinkStructConverter.class) { - converter = this.getSubject().addStructConverter(getSubject().structConvertersSize()); - } - else if (converterType == EclipseLinkTypeConverter.class) { - converter = this.getSubject().addTypeConverter(getSubject().typeConvertersSize()); - } - else { - throw new IllegalArgumentException(); - } - converter.setName(dialog.getName()); - this.selectedConverterHolder.setValue(converter);//so that it gets selected in the List for the user to edit - } - - private Transformer<EclipseLinkConverter, Control> buildPaneTransformer() { - return new Transformer<EclipseLinkConverter, Control>() { - public Control transform(EclipseLinkConverter converter) { - if (converter == null) { - return null; - } - - if (converter.getType() == EclipseLinkCustomConverter.class) { - return OrmEclipseLinkConvertersComposite.this.converterComposite.getControl(); - } - if (converter.getType() == EclipseLinkObjectTypeConverter.class) { - return OrmEclipseLinkConvertersComposite.this.objectTypeConverterComposite.getControl(); - } - if (converter.getType() == EclipseLinkStructConverter.class) { - return OrmEclipseLinkConvertersComposite.this.structConverterComposite.getControl(); - } - if (converter.getType() == EclipseLinkTypeConverter.class) { - return OrmEclipseLinkConvertersComposite.this.typeConverterComposite.getControl(); - } - - return null; - } - }; - } - - private ListValueModel<EclipseLinkConverter> buildDisplayableConvertersListHolder() { - return new ItemPropertyListValueModelAdapter<EclipseLinkConverter>( - buildEclipseLinkConvertersHolder(), - EclipseLinkConverter.NAME_PROPERTY - ); - } - - private ListValueModel<EclipseLinkConverter> buildEclipseLinkConvertersHolder() { - List<ListValueModel<? extends EclipseLinkConverter>> list = new ArrayList<ListValueModel<? extends EclipseLinkConverter>>(); - list.add(buildCustomConvertersListHolder()); - list.add(buildObjectTypeConvertersListHolder()); - list.add(buildStructConvertersListHolder()); - list.add(buildTypeConvertersListHolder()); - return new CompositeListValueModel<ListValueModel<? extends EclipseLinkConverter>, EclipseLinkConverter>(list); - } - - private ListValueModel<EclipseLinkCustomConverter> buildCustomConvertersListHolder() { - return new ListAspectAdapter<OrmEclipseLinkConverterContainer, EclipseLinkCustomConverter>( - getSubjectHolder(), - OrmEclipseLinkConverterContainer.CUSTOM_CONVERTERS_LIST) - { - @Override - protected ListIterator<EclipseLinkCustomConverter> listIterator_() { - return this.subject.customConverters(); - } - - @Override - protected int size_() { - return this.subject.customConvertersSize(); - } - }; - } - - private ListValueModel<EclipseLinkObjectTypeConverter> buildObjectTypeConvertersListHolder() { - return new ListAspectAdapter<OrmEclipseLinkConverterContainer, EclipseLinkObjectTypeConverter>( - getSubjectHolder(), - OrmEclipseLinkConverterContainer.OBJECT_TYPE_CONVERTERS_LIST) - { - @Override - protected ListIterator<EclipseLinkObjectTypeConverter> listIterator_() { - return this.subject.objectTypeConverters(); - } - - @Override - protected int size_() { - return this.subject.objectTypeConvertersSize(); - } - }; - } - - private ListValueModel<EclipseLinkStructConverter> buildStructConvertersListHolder() { - return new ListAspectAdapter<OrmEclipseLinkConverterContainer, EclipseLinkStructConverter>( - getSubjectHolder(), - OrmEclipseLinkConverterContainer.STRUCT_CONVERTERS_LIST) - { - @Override - protected ListIterator<EclipseLinkStructConverter> listIterator_() { - return this.subject.structConverters(); - } - - @Override - protected int size_() { - return this.subject.structConvertersSize(); - } - }; - } - - private ListValueModel<EclipseLinkTypeConverter> buildTypeConvertersListHolder() { - return new ListAspectAdapter<OrmEclipseLinkConverterContainer, EclipseLinkTypeConverter>( - getSubjectHolder(), - OrmEclipseLinkConverterContainer.TYPE_CONVERTERS_LIST) - { - @Override - protected ListIterator<EclipseLinkTypeConverter> listIterator_() { - return this.subject.typeConverters(); - } - - @Override - protected int size_() { - return this.subject.typeConvertersSize(); - } - }; - } - - private PropertyValueModel<EclipseLinkCustomConverter> buildCustomConverterHolder() { - return new TransformationPropertyValueModel<EclipseLinkConverter, EclipseLinkCustomConverter>(this.selectedConverterHolder) { - @Override - protected EclipseLinkCustomConverter transform_(EclipseLinkConverter value) { - return value.getType() == EclipseLinkCustomConverter.class ? (EclipseLinkCustomConverter) value : null; - } - }; - } - - private PropertyValueModel<EclipseLinkObjectTypeConverter> buildObjectTypeConverterHolder() { - return new TransformationPropertyValueModel<EclipseLinkConverter, EclipseLinkObjectTypeConverter>(this.selectedConverterHolder) { - @Override - protected EclipseLinkObjectTypeConverter transform_(EclipseLinkConverter value) { - return value.getType() == EclipseLinkObjectTypeConverter.class ? (EclipseLinkObjectTypeConverter) value : null; - } - }; - } - - private PropertyValueModel<EclipseLinkStructConverter> buildStructConverterHolder() { - return new TransformationPropertyValueModel<EclipseLinkConverter, EclipseLinkStructConverter>(this.selectedConverterHolder) { - @Override - protected EclipseLinkStructConverter transform_(EclipseLinkConverter value) { - return value.getType() == EclipseLinkStructConverter.class ? (EclipseLinkStructConverter) value : null; - } - }; - } - - private PropertyValueModel<EclipseLinkTypeConverter> buildTypeConverterHolder() { - return new TransformationPropertyValueModel<EclipseLinkConverter, EclipseLinkTypeConverter>(this.selectedConverterHolder) { - @Override - protected EclipseLinkTypeConverter transform_(EclipseLinkConverter value) { - return value.getType() == EclipseLinkTypeConverter.class ? (EclipseLinkTypeConverter) value : null; - } - }; - } - - private ILabelProvider buildConvertersListLabelProvider() { - return new LabelProvider() { - @Override - public String getText(Object element) { - return ((EclipseLinkConverter) element).getName(); - } - }; - } - - @Override - public void enableWidgets(boolean enabled) { - super.enableWidgets(enabled); - this.listPane.enableWidgets(enabled); - } - - //TODO need to check the converter repository for this, should check all converters, except for the override case, hmm - //we at least need to check typeconverters, converters, structconverters, and objectypeconverters, on this particular - //object. or we need to give a warning about the case where you are overriding or an error if it's not an override? - private Iterator<String> converterNames() { - return new TransformationIterator<EclipseLinkCustomConverter, String>(getSubject().customConverters()) { - @Override - protected String transform(EclipseLinkCustomConverter next) { - return next.getName(); - } - }; - } -}
\ No newline at end of file diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkEmbeddableComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkEmbeddableComposite.java deleted file mode 100644 index d430641898..0000000000 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkEmbeddableComposite.java +++ /dev/null @@ -1,104 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2008, 2010 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm; - -import org.eclipse.jpt.common.ui.WidgetFactory; -import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter; -import org.eclipse.jpt.common.utility.model.value.PropertyValueModel; -import org.eclipse.jpt.jpa.core.context.AccessHolder; -import org.eclipse.jpt.jpa.core.context.Embeddable; -import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkConverterContainer; -import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkEmbeddable; -import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkEmbeddableAdvancedComposite; -import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkUiDetailsMessages; -import org.eclipse.jpt.jpa.ui.details.JpaComposite; -import org.eclipse.jpt.jpa.ui.internal.details.AbstractEmbeddableComposite; -import org.eclipse.jpt.jpa.ui.internal.details.AccessTypeComposite; -import org.eclipse.jpt.jpa.ui.internal.details.orm.MetadataCompleteComposite; -import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmJavaClassChooser; -import org.eclipse.swt.widgets.Composite; - -/** - * This pane does not have any widgets. - * - * @see Embeddable - * @see EmbeddableUiProvider - * - * @version 2.3 - * @since 2.1 - */ -public class OrmEclipseLinkEmbeddableComposite<T extends OrmEclipseLinkEmbeddable> - extends AbstractEmbeddableComposite<T> - implements JpaComposite -{ - /** - * 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 OrmEclipseLinkEmbeddableComposite(PropertyValueModel<? extends T> subjectHolder, - Composite parent, - WidgetFactory widgetFactory) { - - super(subjectHolder, parent, widgetFactory); - } - - @Override - protected void initializeLayout(Composite container) { - this.initializeEmbeddableCollapsibleSection(container); - initializeConvertersCollapsibleSection(container); - initializeAdvancedCollapsibleSection(container); - } - - @Override - protected void initializeEmbeddableSection(Composite container) { - new OrmJavaClassChooser(this, getSubjectHolder(), container); - new AccessTypeComposite(this, buildAccessHolder(), container); - new MetadataCompleteComposite(this, getSubjectHolder(), container); - } - - protected PropertyValueModel<AccessHolder> buildAccessHolder() { - return new PropertyAspectAdapter<T, AccessHolder>( - getSubjectHolder()) - { - @Override - protected AccessHolder buildValue_() { - return this.subject.getPersistentType(); - } - }; - } - protected void initializeConvertersCollapsibleSection(Composite container) { - - container = addCollapsibleSection( - container, - EclipseLinkUiDetailsMessages.EclipseLinkTypeMappingComposite_converters - ); - initializeConvertersSection(container, this.buildConverterContainerModel()); - } - - protected void initializeConvertersSection(Composite container, PropertyValueModel<OrmEclipseLinkConverterContainer> converterHolder) { - new OrmEclipseLinkConvertersComposite(this, converterHolder, container); - } - - private PropertyValueModel<OrmEclipseLinkConverterContainer> buildConverterContainerModel() { - return new PropertyAspectAdapter<T, OrmEclipseLinkConverterContainer>(getSubjectHolder()) { - @Override - protected OrmEclipseLinkConverterContainer buildValue_() { - return this.subject.getConverterContainer(); - } - }; - } - - protected void initializeAdvancedCollapsibleSection(Composite container) { - new EclipseLinkEmbeddableAdvancedComposite(this, container); - } -}
\ No newline at end of file diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkEntityComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkEntityComposite.java deleted file mode 100644 index 5a694741b2..0000000000 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkEntityComposite.java +++ /dev/null @@ -1,26 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2008, 2009 Oracle. - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Oracle - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm; - -import org.eclipse.jpt.common.ui.WidgetFactory; -import org.eclipse.jpt.common.utility.model.value.PropertyValueModel; -import org.eclipse.jpt.jpa.core.context.orm.OrmEntity; -import org.eclipse.swt.widgets.Composite; - -public class OrmEclipseLinkEntityComposite extends AbstractOrmEclipseLinkEntityComposite -{ - public OrmEclipseLinkEntityComposite( - PropertyValueModel<? extends OrmEntity> subjectHolder, - Composite parent, WidgetFactory widgetFactory) { - super(subjectHolder, parent, widgetFactory); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkExistenceCheckingComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkExistenceCheckingComposite.java deleted file mode 100644 index d136b9964a..0000000000 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkExistenceCheckingComposite.java +++ /dev/null @@ -1,107 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2008, 2010 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm; - -import java.util.Collection; -import org.eclipse.jpt.common.ui.internal.widgets.EnumFormComboViewer; -import org.eclipse.jpt.common.ui.internal.widgets.Pane; -import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCaching; -import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkExistenceType; -import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkUiDetailsMessages; -import org.eclipse.swt.widgets.Composite; - -/** - * Here is the layout of this pane: - * <pre> - * ------------------------------------------------------------------------- - * | ---------------------------------------------- | - * | x Existence Checking: | |v| | - * | ---------------------------------------------- | - * -------------------------------------------------------------------------</pre> - * - * @see EclipseLinkCaching - * @see CachingComposite - A container of this widget - * - * @version 2.1 - * @since 2.1 - */ -public class OrmEclipseLinkExistenceCheckingComposite extends Pane<EclipseLinkCaching> { - - /** - * Creates a new <code>ExistenceCheckingComposite</code>. - * - * @param parentPane The parent container of this one - * @param parent The parent container - */ - public OrmEclipseLinkExistenceCheckingComposite(Pane<? extends EclipseLinkCaching> parentPane, - Composite parent) { - - super(parentPane, parent, false); - } - - @Override - protected void initializeLayout(Composite container) { - - addLabeledComposite( - container, - EclipseLinkUiDetailsMessages.EclipseLinkExistenceCheckingComposite_label, - addExistenceCheckingTypeCombo(container).getControl(), - null - ); - } - - private EnumFormComboViewer<EclipseLinkCaching, EclipseLinkExistenceType> addExistenceCheckingTypeCombo(Composite container) { - - return new EnumFormComboViewer<EclipseLinkCaching, EclipseLinkExistenceType>(this, container) { - - @Override - protected void addPropertyNames(Collection<String> propertyNames) { - super.addPropertyNames(propertyNames); - propertyNames.add(EclipseLinkCaching.DEFAULT_EXISTENCE_TYPE_PROPERTY); - propertyNames.add(EclipseLinkCaching.SPECIFIED_EXISTENCE_TYPE_PROPERTY); - } - - @Override - protected EclipseLinkExistenceType[] getChoices() { - return EclipseLinkExistenceType.values(); - } - - @Override - protected EclipseLinkExistenceType getDefaultValue() { - return getSubject().getDefaultExistenceType(); - } - - @Override - protected String displayString(EclipseLinkExistenceType value) { - return buildDisplayString( - EclipseLinkUiDetailsMessages.class, - OrmEclipseLinkExistenceCheckingComposite.this, - value - ); - } - - @Override - protected EclipseLinkExistenceType getValue() { - return getSubject().getSpecifiedExistenceType(); - } - - @Override - protected void setValue(EclipseLinkExistenceType value) { - getSubject().setSpecifiedExistenceType(value); - } - - @Override - protected boolean sortChoices() { - return false; - } - }; - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkIdMappingComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkIdMappingComposite.java deleted file mode 100644 index 2a3ed20dcd..0000000000 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkIdMappingComposite.java +++ /dev/null @@ -1,49 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2008, 2011 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm; - -import org.eclipse.jpt.common.ui.WidgetFactory; -import org.eclipse.jpt.common.ui.internal.widgets.Pane; -import org.eclipse.jpt.common.utility.model.value.PropertyValueModel; -import org.eclipse.jpt.jpa.core.context.IdMapping; -import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConvert; -import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkIdMappingComposite; -import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkMutableComposite; -import org.eclipse.jpt.jpa.ui.internal.details.ColumnComposite; -import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmMappingNameChooser; -import org.eclipse.swt.widgets.Composite; - -//Remove the Converters section from 1.0 orm id mappings. -//This is supported in EclipseLink in version 1.1, but not 1.0 -public class OrmEclipseLinkIdMappingComposite - extends EclipseLinkIdMappingComposite<IdMapping> -{ - public OrmEclipseLinkIdMappingComposite( - PropertyValueModel<? extends IdMapping> subjectHolder, - Composite parent, - WidgetFactory widgetFactory) { - - super(subjectHolder, parent, widgetFactory); - } - - - @Override - protected void initializeIdSection(Composite container) { - new ColumnComposite(this, buildColumnHolder(), container); - new OrmMappingNameChooser(this, getSubjectHolder(), container); - new EclipseLinkMutableComposite(this, buildMutableHolder(), container); - } - - @Override - //everything but the 'Define Converter' section. This is not supported in eclipselink 1.0, but is in 1.1 - protected Pane<EclipseLinkConvert> buildConvertComposite(PropertyValueModel<EclipseLinkConvert> convertHolder, Composite container) { - return new OrmEclipseLinkConvert1_0Composite(convertHolder, container, getWidgetFactory()); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkManyToManyMappingComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkManyToManyMappingComposite.java deleted file mode 100644 index 6ff34d465c..0000000000 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkManyToManyMappingComposite.java +++ /dev/null @@ -1,93 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm; - -import org.eclipse.jpt.common.ui.WidgetFactory; -import org.eclipse.jpt.common.utility.model.value.PropertyValueModel; -import org.eclipse.jpt.jpa.core.context.ManyToManyMapping; -import org.eclipse.jpt.jpa.core.context.orm.OrmManyToManyMapping; -import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkJoinFetchComposite; -import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkManyToManyMappingComposite; -import org.eclipse.jpt.jpa.ui.internal.details.CascadeComposite; -import org.eclipse.jpt.jpa.ui.internal.details.FetchTypeComposite; -import org.eclipse.jpt.jpa.ui.internal.details.ManyToManyJoiningStrategyPane; -import org.eclipse.jpt.jpa.ui.internal.details.OrderingComposite; -import org.eclipse.jpt.jpa.ui.internal.details.TargetEntityComposite; -import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmMappingNameChooser; -import org.eclipse.swt.widgets.Composite; - -/** - * Here the layout of this pane: - * <pre> - * ----------------------------------------------------------------------------- - * | ------------------------------------------------------------------------- | - * | | | | - * | | TargetEntityComposite | | - * | | | | - * | ------------------------------------------------------------------------- | - * | ------------------------------------------------------------------------- | - * | | | | - * | | JoiningStrategyComposite | | - * | | | | - * | ------------------------------------------------------------------------- | - * | ------------------------------------------------------------------------- | - * | | | | - * | | FetchTypeComposite | | - * | | | | - * | ------------------------------------------------------------------------- | - * | ------------------------------------------------------------------------- | - * | | | | - * | | CascadeComposite | | - * | | | | - * | ------------------------------------------------------------------------- | - * | ------------------------------------------------------------------------- | - * | | | | - * | | OrderingComposite | | - * | | | | - * | ------------------------------------------------------------------------- | - * -----------------------------------------------------------------------------</pre> - * - * @see {@link ManyToManyMapping} - * @see {@link TargetEntityComposite} - * @see {@link ManyToManyJoiningStrategyPane} - * @see {@link FetchTypeComposite} - * @see {@link CascadeComposite} - * @see {@link OrderingComposite} - * - * @version 2.3 - * @since 2.2 - */ -public class OrmEclipseLinkManyToManyMappingComposite - extends EclipseLinkManyToManyMappingComposite<OrmManyToManyMapping> -{ - /** - * 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 OrmEclipseLinkManyToManyMappingComposite(PropertyValueModel<? extends OrmManyToManyMapping> subjectHolder, - Composite parent, - WidgetFactory widgetFactory) { - - super(subjectHolder, parent, widgetFactory); - } - - @Override - protected void initializeManyToManySection(Composite container) { - new TargetEntityComposite(this, container); - new OrmMappingNameChooser(this, getSubjectHolder(), container); - new FetchTypeComposite(this, container); - new EclipseLinkJoinFetchComposite(this, buildJoinFetchableHolder(), container); - new CascadeComposite(this, buildCascadeHolder(), addSubPane(container, 5)); - } - -}
\ No newline at end of file diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkManyToOneMappingComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkManyToOneMappingComposite.java deleted file mode 100644 index fd1fb6daf9..0000000000 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkManyToOneMappingComposite.java +++ /dev/null @@ -1,104 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm; - -import org.eclipse.jpt.common.ui.WidgetFactory; -import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter; -import org.eclipse.jpt.common.utility.model.value.PropertyValueModel; -import org.eclipse.jpt.jpa.core.context.AccessHolder; -import org.eclipse.jpt.jpa.core.context.ManyToOneMapping; -import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkJoinFetchComposite; -import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkManyToOneMappingComposite; -import org.eclipse.jpt.jpa.ui.internal.details.CascadeComposite; -import org.eclipse.jpt.jpa.ui.internal.details.FetchTypeComposite; -import org.eclipse.jpt.jpa.ui.internal.details.ManyToOneJoiningStrategyPane; -import org.eclipse.jpt.jpa.ui.internal.details.OptionalComposite; -import org.eclipse.jpt.jpa.ui.internal.details.TargetEntityComposite; -import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmMappingNameChooser; -import org.eclipse.swt.widgets.Composite; - -/** - * Here the layout of this pane: - * <pre> - * ----------------------------------------------------------------------------- - * | ------------------------------------------------------------------------- | - * | | | | - * | | TargetEntityComposite | | - * | | | | - * | ------------------------------------------------------------------------- | - * | ------------------------------------------------------------------------- | - * | | | | - * | | JoiningStrategyComposite | | - * | | | | - * | ------------------------------------------------------------------------- | - * | ------------------------------------------------------------------------- | - * | | | | - * | | FetchTypeComposite | | - * | | | | - * | ------------------------------------------------------------------------- | - * | ------------------------------------------------------------------------- | - * | | | | - * | | OptionalComposite | | - * | | | | - * | ------------------------------------------------------------------------- | - * | ------------------------------------------------------------------------- | - * | | | | - * | | CascadeComposite | | - * | | | | - * | ------------------------------------------------------------------------- | - * -----------------------------------------------------------------------------</pre> - * - * @see {@link ManyToOneMapping} - * @see {@link TargetEntityComposite} - * @see {@link ManyToOneJoiningStrategyPane} - * @see {@link FetchTypeComposite} - * @see {@link OptionalComposite} - * @see {@link CascadeComposite} - * - * @version 2.3 - * @since 2.2 - */ -public class OrmEclipseLinkManyToOneMappingComposite - extends EclipseLinkManyToOneMappingComposite<ManyToOneMapping> -{ - /** - * Creates a new <code>EclipseLink1_1ManyToOneMappingComposite</code>. - * - * @param subjectHolder The holder of the subject <code>ManyToOneMapping</code> - * @param parent The parent container - * @param widgetFactory The factory used to create various common widgets - */ - public OrmEclipseLinkManyToOneMappingComposite(PropertyValueModel<? extends ManyToOneMapping> subjectHolder, - Composite parent, - WidgetFactory widgetFactory) { - - super(subjectHolder, parent, widgetFactory); - } - - @Override - protected void initializeManyToOneSection(Composite container) { - new TargetEntityComposite(this, container); - new OrmMappingNameChooser(this, getSubjectHolder(), container); - new FetchTypeComposite(this, container); - new EclipseLinkJoinFetchComposite(this, buildJoinFetchableHolder(), container); - new OptionalComposite(this, container); - new CascadeComposite(this, buildCascadeHolder(), addSubPane(container, 5)); - } - - protected PropertyValueModel<AccessHolder> buildAccessHolderHolder() { - return new PropertyAspectAdapter<ManyToOneMapping, AccessHolder>(getSubjectHolder()) { - @Override - protected AccessHolder buildValue_() { - return this.subject.getPersistentAttribute(); - } - }; - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkMappedSuperclassComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkMappedSuperclassComposite.java deleted file mode 100644 index a440afabdf..0000000000 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkMappedSuperclassComposite.java +++ /dev/null @@ -1,27 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2008, 2010 Oracle. - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Oracle - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm; - -import org.eclipse.jpt.common.ui.WidgetFactory; -import org.eclipse.jpt.common.utility.model.value.PropertyValueModel; -import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkMappedSuperclass; -import org.eclipse.swt.widgets.Composite; - -public class OrmEclipseLinkMappedSuperclassComposite<T extends OrmEclipseLinkMappedSuperclass> - extends AbstractOrmEclipseLinkMappedSuperclassComposite<T> -{ - public OrmEclipseLinkMappedSuperclassComposite( - PropertyValueModel<? extends T> subjectHolder, - Composite parent, WidgetFactory widgetFactory) { - - super(subjectHolder, parent, widgetFactory); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkOneToManyMappingComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkOneToManyMappingComposite.java deleted file mode 100644 index 36ffb7e3b0..0000000000 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkOneToManyMappingComposite.java +++ /dev/null @@ -1,55 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm; - -import org.eclipse.jpt.common.ui.WidgetFactory; -import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter; -import org.eclipse.jpt.common.utility.model.value.PropertyValueModel; -import org.eclipse.jpt.jpa.core.context.AccessHolder; -import org.eclipse.jpt.jpa.core.context.OneToManyMapping; -import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkJoinFetchComposite; -import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkOneToManyMappingComposite; -import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkPrivateOwnedComposite; -import org.eclipse.jpt.jpa.ui.internal.details.CascadeComposite; -import org.eclipse.jpt.jpa.ui.internal.details.FetchTypeComposite; -import org.eclipse.jpt.jpa.ui.internal.details.TargetEntityComposite; -import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmMappingNameChooser; -import org.eclipse.swt.widgets.Composite; - - -public class OrmEclipseLinkOneToManyMappingComposite - extends EclipseLinkOneToManyMappingComposite<OneToManyMapping> -{ - public OrmEclipseLinkOneToManyMappingComposite( - PropertyValueModel<? extends OneToManyMapping> subjectHolder, - Composite parent, - WidgetFactory widgetFactory) { - super(subjectHolder, parent, widgetFactory); - } - - @Override - protected void initializeOneToManySection(Composite container) { - new TargetEntityComposite(this, container); - new OrmMappingNameChooser(this, getSubjectHolder(), container); - new FetchTypeComposite(this, container); - new EclipseLinkJoinFetchComposite(this, buildJoinFetchableHolder(), container); - new EclipseLinkPrivateOwnedComposite(this, buildPrivateOwnableHolder(), container); - new CascadeComposite(this, buildCascadeHolder(), addSubPane(container, 5)); - } - - protected PropertyValueModel<AccessHolder> buildAccessHolderHolder() { - return new PropertyAspectAdapter<OneToManyMapping, AccessHolder>(getSubjectHolder()) { - @Override - protected AccessHolder buildValue_() { - return this.subject.getPersistentAttribute(); - } - }; - } -}
\ No newline at end of file diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkOneToOneMappingComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkOneToOneMappingComposite.java deleted file mode 100644 index e67e9d51fa..0000000000 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkOneToOneMappingComposite.java +++ /dev/null @@ -1,126 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm; - -import org.eclipse.jpt.common.ui.WidgetFactory; -import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter; -import org.eclipse.jpt.common.utility.model.value.PropertyValueModel; -import org.eclipse.jpt.jpa.core.context.AccessHolder; -import org.eclipse.jpt.jpa.core.context.OneToOneMapping; -import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkJoinFetchComposite; -import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkOneToOneMappingComposite; -import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkPrivateOwnedComposite; -import org.eclipse.jpt.jpa.ui.internal.details.AccessTypeComposite; -import org.eclipse.jpt.jpa.ui.internal.details.CascadeComposite; -import org.eclipse.jpt.jpa.ui.internal.details.FetchTypeComposite; -import org.eclipse.jpt.jpa.ui.internal.details.MappedByPane; -import org.eclipse.jpt.jpa.ui.internal.details.OneToOneJoiningStrategyPane; -import org.eclipse.jpt.jpa.ui.internal.details.OptionalComposite; -import org.eclipse.jpt.jpa.ui.internal.details.TargetEntityComposite; -import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmMappingNameChooser; -import org.eclipse.swt.widgets.Composite; - -/** - * Here the layout of this pane: - * <pre> - * ----------------------------------------------------------------------------- - * | ------------------------------------------------------------------------- | - * | | | | - * | | TargetEntityComposite | | - * | | | | - * | ------------------------------------------------------------------------- | - * | ------------------------------------------------------------------------- | - * | | | | - * | | AccessTypeComposite | | - * | | | | - * | ------------------------------------------------------------------------- | - * | ------------------------------------------------------------------------- | - * | | | | - * | | OneToOneJoiningStrategyPane | | - * | | | | - * | ------------------------------------------------------------------------- | - * | ------------------------------------------------------------------------- | - * | | | | - * | | FetchTypeComposite | | - * | | | | - * | ------------------------------------------------------------------------- | - * | ------------------------------------------------------------------------- | - * | | | | - * | | EclipseLinkJoinFetchComposite | | - * | | | | - * | ------------------------------------------------------------------------- | - * | ------------------------------------------------------------------------- | - * | | | | - * | | OptionalComposite | | - * | | | | - * | ------------------------------------------------------------------------- | - * | ------------------------------------------------------------------------- | - * | | | | - * | | EclipseLinkPrivateOwnedComposite | | - * | | | | - * | ------------------------------------------------------------------------- | - * | ------------------------------------------------------------------------- | - * | | | | - * | | CascadeComposite | | - * | | | | - * | ------------------------------------------------------------------------- | - * -----------------------------------------------------------------------------</pre> - * - * @see OneToOneMapping - * @see AccessTypeComposite - * @see CascadeComposite - * @see EclipseLinkJoinFetchComposite - * @see EclipseLinkPrivateOwnedComposite - * @see FetchTypeComposite - * @see MappedByPane - * @see OneToOneJoiningStrategyPane - * @see OptionalComposite - * @see TargetEntityComposite - * - * @version 2.2 - * @since 2.2 - */ -public class OrmEclipseLinkOneToOneMappingComposite -extends EclipseLinkOneToOneMappingComposite<OneToOneMapping> -{ - /** - * Creates a new <code>Eclipselink1_1OneToOneMappingComposite</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 OrmEclipseLinkOneToOneMappingComposite(PropertyValueModel<? extends OneToOneMapping> subjectHolder, - Composite parent, - WidgetFactory widgetFactory) { - - super(subjectHolder, parent, widgetFactory); - } - - @Override - protected void initializeOneToOneSection(Composite container) { - new TargetEntityComposite(this, container); - new OrmMappingNameChooser(this, getSubjectHolder(), container); - new FetchTypeComposite(this, container); - new EclipseLinkJoinFetchComposite(this, buildJoinFetchableHolder(), container); - new OptionalComposite(this, container); - new EclipseLinkPrivateOwnedComposite(this, buildPrivateOwnableHolder(), container); - new CascadeComposite(this, buildCascadeHolder(), addSubPane(container, 5)); - } - - protected PropertyValueModel<AccessHolder> buildAccessHolderHolder() { - return new PropertyAspectAdapter<OneToOneMapping, AccessHolder>(getSubjectHolder()) { - @Override - protected AccessHolder buildValue_() { - return this.subject.getPersistentAttribute(); - } - }; - } -}
\ No newline at end of file diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkTransformationMappingUiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkTransformationMappingUiDefinition.java deleted file mode 100644 index 06ba78f760..0000000000 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkTransformationMappingUiDefinition.java +++ /dev/null @@ -1,56 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2009, 2011 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm; - -import org.eclipse.jpt.common.ui.WidgetFactory; -import org.eclipse.jpt.common.utility.model.value.PropertyValueModel; -import org.eclipse.jpt.jpa.core.context.ReadOnlyPersistentAttribute; -import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkTransformationMapping; -import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.AbstractEclipseLinkTransformationMappingUiDefinition; -import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkTransformationMappingComposite; -import org.eclipse.jpt.jpa.ui.details.JpaComposite; -import org.eclipse.jpt.jpa.ui.details.orm.OrmAttributeMappingUiDefinition; -import org.eclipse.jpt.jpa.ui.details.orm.OrmXmlUiFactory; -import org.eclipse.swt.widgets.Composite; - -public class OrmEclipseLinkTransformationMappingUiDefinition - extends AbstractEclipseLinkTransformationMappingUiDefinition<ReadOnlyPersistentAttribute, EclipseLinkTransformationMapping> - implements OrmAttributeMappingUiDefinition<EclipseLinkTransformationMapping> -{ - // singleton - private static final OrmEclipseLinkTransformationMappingUiDefinition INSTANCE = - new OrmEclipseLinkTransformationMappingUiDefinition(); - - - /** - * Return the singleton. - */ - public static OrmAttributeMappingUiDefinition<EclipseLinkTransformationMapping> instance() { - return INSTANCE; - } - - - /** - * Ensure single instance. - */ - private OrmEclipseLinkTransformationMappingUiDefinition() { - super(); - } - - - public JpaComposite buildAttributeMappingComposite( - OrmXmlUiFactory factory, - PropertyValueModel<EclipseLinkTransformationMapping> subjectHolder, - Composite parent, - WidgetFactory widgetFactory) { - - return new EclipseLinkTransformationMappingComposite(subjectHolder, parent, widgetFactory); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkVariableOneToOneMappingUiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkVariableOneToOneMappingUiDefinition.java deleted file mode 100644 index bbf3b0dc07..0000000000 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkVariableOneToOneMappingUiDefinition.java +++ /dev/null @@ -1,56 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2009, 2011 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm; - -import org.eclipse.jpt.common.ui.WidgetFactory; -import org.eclipse.jpt.common.utility.model.value.PropertyValueModel; -import org.eclipse.jpt.jpa.core.context.ReadOnlyPersistentAttribute; -import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkVariableOneToOneMapping; -import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.AbstractEclipseLinkVariableOneToOneMappingUiDefinition; -import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkVariableOneToOneMappingComposite; -import org.eclipse.jpt.jpa.ui.details.JpaComposite; -import org.eclipse.jpt.jpa.ui.details.orm.OrmAttributeMappingUiDefinition; -import org.eclipse.jpt.jpa.ui.details.orm.OrmXmlUiFactory; -import org.eclipse.swt.widgets.Composite; - -public class OrmEclipseLinkVariableOneToOneMappingUiDefinition - extends AbstractEclipseLinkVariableOneToOneMappingUiDefinition<ReadOnlyPersistentAttribute, EclipseLinkVariableOneToOneMapping> - implements OrmAttributeMappingUiDefinition<EclipseLinkVariableOneToOneMapping> -{ - // singleton - private static final OrmEclipseLinkVariableOneToOneMappingUiDefinition INSTANCE = - new OrmEclipseLinkVariableOneToOneMappingUiDefinition(); - - - /** - * Return the singleton. - */ - public static OrmAttributeMappingUiDefinition<EclipseLinkVariableOneToOneMapping> instance() { - return INSTANCE; - } - - - /** - * Ensure single instance. - */ - private OrmEclipseLinkVariableOneToOneMappingUiDefinition() { - super(); - } - - - public JpaComposite buildAttributeMappingComposite( - OrmXmlUiFactory factory, - PropertyValueModel<EclipseLinkVariableOneToOneMapping> subjectHolder, - Composite parent, - WidgetFactory widgetFactory) { - - return new EclipseLinkVariableOneToOneMappingComposite(subjectHolder, parent, widgetFactory); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkVersionMappingComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkVersionMappingComposite.java deleted file mode 100644 index e86a38c500..0000000000 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkVersionMappingComposite.java +++ /dev/null @@ -1,55 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2008, 2010 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm; - -import org.eclipse.jpt.common.ui.WidgetFactory; -import org.eclipse.jpt.common.ui.internal.widgets.Pane; -import org.eclipse.jpt.common.utility.model.value.PropertyValueModel; -import org.eclipse.jpt.jpa.core.context.VersionMapping; -import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConvert; -import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkMutableComposite; -import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkVersionMappingComposite; -import org.eclipse.jpt.jpa.ui.internal.details.ColumnComposite; -import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmMappingNameChooser; -import org.eclipse.swt.widgets.Composite; - -//Remove the Converters section from 1.0 orm version mappings. -//This is supported in EclipseLink in version 1.1, but not 1.0 -public class OrmEclipseLinkVersionMappingComposite - extends EclipseLinkVersionMappingComposite<VersionMapping> -{ - /** - * Creates a new <code>EclipseLinkOrmVersionMappingComposite</code>. - * - * @param subjectHolder The holder of the subject <code>VersionMapping</code> - * @param parent The parent container - * @param widgetFactory The factory used to create various common widgets - */ - public OrmEclipseLinkVersionMappingComposite(PropertyValueModel<? extends VersionMapping> subjectHolder, - Composite parent, - WidgetFactory widgetFactory) { - - super(subjectHolder, parent, widgetFactory); - } - - @Override - protected void initializeVersionSection(Composite container) { - new ColumnComposite(this, buildColumnHolder(), container); - new OrmMappingNameChooser(this, getSubjectHolder(), container); - new EclipseLinkMutableComposite(this, buildMutableHolder(), container); - } - - - @Override - //everything but the 'Define Converter' section. This is not supported in eclipselink 1.0, but is in 1.1 - protected Pane<EclipseLinkConvert> buildConvertComposite(PropertyValueModel<EclipseLinkConvert> convertHolder, Composite container) { - return new OrmEclipseLinkConvert1_0Composite(convertHolder, container, getWidgetFactory()); - } -}
\ No newline at end of file |