diff options
Diffstat (limited to 'jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm')
50 files changed, 0 insertions, 4569 deletions
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/AbstractEntityMappingsDetailsPage.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/AbstractEntityMappingsDetailsPage.java deleted file mode 100644 index bc78d9cc89..0000000000 --- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/AbstractEntityMappingsDetailsPage.java +++ /dev/null @@ -1,268 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2010 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.jpa.ui.internal.details.orm; - -import java.util.Collection; - -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.SimplePropertyValueModel; -import org.eclipse.jpt.common.utility.internal.model.value.TransformationPropertyValueModel; -import org.eclipse.jpt.common.utility.model.value.PropertyValueModel; -import org.eclipse.jpt.jpa.core.context.AccessType; -import org.eclipse.jpt.jpa.core.context.orm.EntityMappings; -import org.eclipse.jpt.jpa.core.context.orm.OrmPersistenceUnitMetadata; -import org.eclipse.jpt.jpa.db.SchemaContainer; -import org.eclipse.jpt.jpa.ui.internal.JpaHelpContextIds; -import org.eclipse.jpt.jpa.ui.internal.details.AbstractJpaDetailsPage; -import org.eclipse.jpt.jpa.ui.internal.details.db.CatalogCombo; -import org.eclipse.jpt.jpa.ui.internal.details.db.SchemaCombo; -import org.eclipse.swt.widgets.Composite; - -/** - * Here the layout of this pane: - * <pre> - * ----------------------------------------------------------------------------- - * | ------------------------------------------------------------------------- | - * | | | | - * | | XmlPackageChooser | | - * | | | | - * | ------------------------------------------------------------------------- | - * | ------------------------------------------------------------ | - * | Schema: | SchemaCombo | | - * | ------------------------------------------------------------ | - * | ------------------------------------------------------------ | - * | Catalog: | CatalogCombo | | - * | ------------------------------------------------------------ | - * | ------------------------------------------------------------ | - * | Access Type: | |v| | - * | ------------------------------------------------------------ | - * | | - * | ------------------------------------------------------------------------- | - * | | | | - * | | PersistenceUnitMetadataComposite | | - * | | | | - * | ------------------------------------------------------------------------- | - * | ------------------------------------------------------------------------- | - * | | | | - * | | OrmGeneratorsComposite | | - * | | | | - * | ------------------------------------------------------------------------- | - * | ------------------------------------------------------------------------- | - * | | | | - * | | OrmQueriesComposite | | - * | | | | - * | ------------------------------------------------------------------------- | - * -----------------------------------------------------------------------------</pre> - * - * @see EntityMappings - * @see AbstractEntityMappingsDetailsPage - The parent container - * @see CatalogCombo - * @see EnumFormComboViewer - * @see EntityMappingsGeneratorsComposite - * @see OrmPackageChooser - * @see OrmQueriesComposite - * @see PersistenceUnitMetadataComposite - * @see SchemaCombo - * - * @version 2.3 - * @since 2.0 - */ -public abstract class AbstractEntityMappingsDetailsPage extends AbstractJpaDetailsPage<EntityMappings> -{ - /** - * Creates a new <code>EntityMappingsDetailsPage</code>. - * - * @param parent The parent container - * @param widgetFactory The factory used to create various common widgets - */ - protected AbstractEntityMappingsDetailsPage(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); - } - - protected void initializeEntityMappingsCollapsibleSection(Composite container) { - container = addCollapsibleSection( - container, - JptUiDetailsOrmMessages.EntityMappingsSection_title, - new SimplePropertyValueModel<Boolean>(Boolean.TRUE) - ); - - this.initializeEntityMappingsSection(container); - } - - protected void initializeEntityMappingsSection(Composite container) { - // Package widgets - new OrmPackageChooser(this, container); - - // Schema widgets - addLabeledComposite( - container, - JptUiDetailsOrmMessages.EntityMappingsDetailsPage_schema, - addSchemaCombo(container), - JpaHelpContextIds.ENTITY_ORM_SCHEMA - ); - - // Catalog widgets - addLabeledComposite( - container, - JptUiDetailsOrmMessages.EntityMappingsDetailsPage_catalog, - addCatalogCombo(container), - JpaHelpContextIds.ENTITY_ORM_CATALOG - ); - - // Access Type widgets - addLabeledComposite( - container, - JptUiDetailsOrmMessages.EntityMappingsDetailsPage_access, - addAccessTypeCombo(container), - JpaHelpContextIds.ENTITY_ORM_ACCESS - ); - } - - protected void initializePersistenceUnitMetadataCollapsibleSection(Composite container) { - new PersistenceUnitMetadataComposite( - this, - buildPersistentUnitMetadataHolder(), - addSubPane(container, 5) - ); - } - - protected EnumFormComboViewer<EntityMappings, AccessType> addAccessTypeCombo(Composite container) { - - return new EnumFormComboViewer<EntityMappings, AccessType>(this, container) { - - @Override - protected void addPropertyNames(Collection<String> propertyNames) { - super.addPropertyNames(propertyNames); - propertyNames.add(EntityMappings.DEFAULT_ACCESS_PROPERTY); - propertyNames.add(EntityMappings.SPECIFIED_ACCESS_PROPERTY); - } - - @Override - protected AccessType[] getChoices() { - return AccessType.values(); - } - - @Override - protected AccessType getDefaultValue() { - return getSubject().getDefaultAccess(); - } - - @Override - protected String displayString(AccessType value) { - return value == AccessType.FIELD ? - JptUiDetailsOrmMessages.EntityMappingsDetailsPage_field : - JptUiDetailsOrmMessages.EntityMappingsDetailsPage_property; - } - - @Override - protected AccessType getValue() { - return getSubject().getSpecifiedAccess(); - } - - @Override - protected void setValue(AccessType value) { - getSubject().setSpecifiedAccess(value); - } - }; - } - - protected CatalogCombo<EntityMappings> addCatalogCombo(Composite container) { - - return new CatalogCombo<EntityMappings>(this, container) { - - @Override - protected void addPropertyNames(Collection<String> propertyNames) { - super.addPropertyNames(propertyNames); - propertyNames.add(EntityMappings.DEFAULT_CATALOG_PROPERTY); - propertyNames.add(EntityMappings.SPECIFIED_CATALOG_PROPERTY); - } - - @Override - protected String getDefaultValue() { - return getSubject().getDefaultCatalog(); - } - - @Override - protected void setValue(String value) { - getSubject().setSpecifiedCatalog(value); - } - - @Override - protected String getValue() { - return getSubject().getSpecifiedCatalog(); - } - }; - } - - protected PropertyValueModel<OrmPersistenceUnitMetadata> buildPersistentUnitMetadataHolder() { - return new TransformationPropertyValueModel<EntityMappings, OrmPersistenceUnitMetadata>(getSubjectHolder()) { - @Override - protected OrmPersistenceUnitMetadata transform_(EntityMappings value) { - return value.getPersistenceUnitMetadata(); - } - }; - } - - protected SchemaCombo<EntityMappings> addSchemaCombo(Composite container) { - - return new SchemaCombo<EntityMappings>(this, container) { - - @Override - protected void addPropertyNames(Collection<String> propertyNames) { - super.addPropertyNames(propertyNames); - propertyNames.add(EntityMappings.DEFAULT_SCHEMA_PROPERTY); - propertyNames.add(EntityMappings.SPECIFIED_SCHEMA_PROPERTY); - } - - @Override - protected String getDefaultValue() { - return getSubject().getDefaultSchema(); - } - - @Override - protected void setValue(String value) { - getSubject().setSpecifiedSchema(value); - } - - @Override - protected String getValue() { - return getSubject().getSpecifiedSchema(); - } - - @Override - protected SchemaContainer getDbSchemaContainer_() { - return this.getSubject().getDbSchemaContainer(); - } - - }; - } - - protected void initializeGeneratorsCollapsibleSection(Composite container) { - new EntityMappingsGeneratorsComposite( - this, - container - ); - } - - protected void initializeQueriesCollapsibleSection(Composite container) { - new OrmQueriesComposite(this, container); - } -}
\ No newline at end of file diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/AbstractOrmEntityComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/AbstractOrmEntityComposite.java deleted file mode 100644 index 97d8424fe4..0000000000 --- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/AbstractOrmEntityComposite.java +++ /dev/null @@ -1,90 +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.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.orm.OrmEntity; -import org.eclipse.jpt.jpa.ui.internal.details.AbstractEntityComposite; -import org.eclipse.jpt.jpa.ui.internal.details.AccessTypeComposite; -import org.eclipse.jpt.jpa.ui.internal.details.EntityNameComposite; -import org.eclipse.jpt.jpa.ui.internal.details.IdClassComposite; -import org.eclipse.jpt.jpa.ui.internal.details.TableComposite; -import org.eclipse.jpt.jpa.ui.internal.details.java.BaseJavaUiFactory; -import org.eclipse.swt.widgets.Composite; - -/** - * The pane used for an ORM entity. - * - * @see OrmEntity - * @see BaseJavaUiFactory - The factory creating this pane - * - * @version 2.3 - * @since 1.0 - */ -public abstract class AbstractOrmEntityComposite extends AbstractEntityComposite<OrmEntity> -{ - /** - * Creates a new <code>OrmEntityComposite</code>. - * - * @param subjectHolder The holder of the subject <code>OrmEntity</code> - * @param parent The parent container - * @param widgetFactory The factory used to create various common widgets - */ - protected AbstractOrmEntityComposite( - PropertyValueModel<? extends OrmEntity> subjectHolder, - Composite parent, - WidgetFactory widgetFactory) { - - super(subjectHolder, parent, widgetFactory); - } - - - @Override - protected void initializeLayout(Composite container) { - this.initializeEntityCollapsibleSection(container); - this.initializeQueriesCollapsibleSection(container); - this.initializeInheritanceCollapsibleSection(container); - this.initializeAttributeOverridesCollapsibleSection(container); - this.initializeGeneratorsCollapsibleSection(container); - this.initializeSecondaryTablesCollapsibleSection(container); - } - - @Override - protected void initializeEntitySection(Composite container) { - new OrmJavaClassChooser(this, getSubjectHolder(), container, false); - new TableComposite(this, container); - new EntityNameComposite(this, container); - new AccessTypeComposite(this, buildAccessHolder(), container); - new IdClassComposite(this, buildIdClassReferenceHolder(), container); - new MetadataCompleteComposite(this, getSubjectHolder(), container); - } - - protected PropertyValueModel<AccessHolder> buildAccessHolder() { - return new PropertyAspectAdapter<OrmEntity, AccessHolder>(getSubjectHolder()){ - @Override - protected AccessHolder buildValue_() { - return this.subject.getPersistentType(); - } - }; - } - - @Override - protected void initializeSecondaryTablesSection(Composite container) { - new OrmSecondaryTablesComposite(this, container); - } - - @Override - protected void initializeInheritanceSection(Composite container) { - new OrmInheritanceComposite(this, container); - } -}
\ No newline at end of file diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/AbstractOrmXmlResourceUiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/AbstractOrmXmlResourceUiDefinition.java deleted file mode 100644 index db11562274..0000000000 --- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/AbstractOrmXmlResourceUiDefinition.java +++ /dev/null @@ -1,174 +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.ui.internal.details.orm; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; -import java.util.ListIterator; -import org.eclipse.jpt.common.ui.WidgetFactory; -import org.eclipse.jpt.common.utility.internal.Tools; -import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator; -import org.eclipse.jpt.common.utility.internal.iterators.ArrayListIterator; -import org.eclipse.jpt.common.utility.model.value.PropertyValueModel; -import org.eclipse.jpt.jpa.core.context.AttributeMapping; -import org.eclipse.jpt.jpa.core.context.PersistentType; -import org.eclipse.jpt.jpa.core.context.ReadOnlyPersistentAttribute; -import org.eclipse.jpt.jpa.core.context.TypeMapping; -import org.eclipse.jpt.jpa.ui.MappingResourceUiDefinition; -import org.eclipse.jpt.jpa.ui.details.DefaultMappingUiDefinition; -import org.eclipse.jpt.jpa.ui.details.JpaComposite; -import org.eclipse.jpt.jpa.ui.details.MappingUiDefinition; -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.swt.widgets.Composite; - -/** - * All the state in the definition should be "static" (i.e. unchanging once it is initialized). - */ -public abstract class AbstractOrmXmlResourceUiDefinition - implements MappingResourceUiDefinition -{ - - private OrmTypeMappingUiDefinition<? extends TypeMapping>[] ormTypeMappingUiDefinitions; - - private OrmAttributeMappingUiDefinition<? extends AttributeMapping>[] ormAttributeMappingUiDefinitions; - - private final OrmXmlUiFactory factory; - - - /** - * zero-argument constructor - */ - protected AbstractOrmXmlResourceUiDefinition() { - super(); - this.factory = buildOrmXmlUiFactory(); - } - - - protected abstract OrmXmlUiFactory buildOrmXmlUiFactory(); - - public OrmXmlUiFactory getFactory() { - return this.factory; - } - - - // ********** ORM type mappings ********** - - public JpaComposite buildTypeMappingComposite(String key, PropertyValueModel<TypeMapping> mappingHolder, Composite parent, WidgetFactory widgetFactory) { - OrmTypeMappingUiDefinition<TypeMapping> mappingUiDefinition = - (OrmTypeMappingUiDefinition<TypeMapping>) getOrmTypeMappingUiDefinition(key); - return mappingUiDefinition.buildTypeMappingComposite( - getFactory(), - mappingHolder, - parent, - widgetFactory - ); - } - - protected OrmTypeMappingUiDefinition<? extends TypeMapping> getOrmTypeMappingUiDefinition(String mappingKey) { - for (OrmTypeMappingUiDefinition<? extends TypeMapping> definition : getOrmTypeMappingUiDefinitions()) { - if (Tools.valuesAreEqual(definition.getKey(), mappingKey)) { - return definition; - } - } - throw new IllegalArgumentException("Illegal type mapping key: " + mappingKey); //$NON-NLS-1$ - } - - public Iterator<MappingUiDefinition<PersistentType, ? extends TypeMapping>> - typeMappingUiDefinitions() { - - return new ArrayIterator<MappingUiDefinition<PersistentType, ? extends TypeMapping>>( - getOrmTypeMappingUiDefinitions()); - } - - protected synchronized OrmTypeMappingUiDefinition<? extends TypeMapping>[] getOrmTypeMappingUiDefinitions() { - if (this.ormTypeMappingUiDefinitions == null) { - this.ormTypeMappingUiDefinitions = this.buildOrmTypeMappingUiDefinitions(); - } - return this.ormTypeMappingUiDefinitions; - } - - - /** - * Return an array of mapping definitions to use for types in mapping files of this type. - * The order is unimportant. - */ - protected OrmTypeMappingUiDefinition<? extends TypeMapping>[] buildOrmTypeMappingUiDefinitions() { - ArrayList<OrmTypeMappingUiDefinition<? extends TypeMapping>> definitions = new ArrayList<OrmTypeMappingUiDefinition<? extends TypeMapping>>(); - this.addOrmTypeMappingUiDefinitionsTo(definitions); - @SuppressWarnings("unchecked") - OrmTypeMappingUiDefinition<? extends TypeMapping>[] definitionArray = definitions.toArray(new OrmTypeMappingUiDefinition[definitions.size()]); - return definitionArray; - } - - protected abstract void addOrmTypeMappingUiDefinitionsTo( - List<OrmTypeMappingUiDefinition<? extends TypeMapping>> definitions); - - public DefaultMappingUiDefinition<PersistentType, ? extends TypeMapping> getDefaultTypeMappingUiDefinition() { - //there is no way to choose an type in the orm.xml that doesn't have a specified mapping so we can return null here - return null; - } - - // ********** ORM attribute mappings ********** - - public JpaComposite buildAttributeMappingComposite(String key, PropertyValueModel<AttributeMapping> mappingHolder, Composite parent, WidgetFactory widgetFactory) { - - OrmAttributeMappingUiDefinition<AttributeMapping> mappingUiDefinition = - (OrmAttributeMappingUiDefinition<AttributeMapping>) getOrmAttributeMappingUiDefinition(key); - return mappingUiDefinition.buildAttributeMappingComposite( - getFactory(), - mappingHolder, - parent, - widgetFactory - ); - } - - protected OrmAttributeMappingUiDefinition<? extends AttributeMapping> getOrmAttributeMappingUiDefinition(String mappingKey) { - for (OrmAttributeMappingUiDefinition<? extends AttributeMapping> definition : getOrmAttributeMappingUiDefinitions()) { - if (Tools.valuesAreEqual(definition.getKey(), mappingKey)) { - return definition; - } - } - return UnsupportedOrmMappingUiDefinition.instance(); - } - - public ListIterator<MappingUiDefinition<ReadOnlyPersistentAttribute, ? extends AttributeMapping>> attributeMappingUiDefinitions() { - return new ArrayListIterator<MappingUiDefinition<ReadOnlyPersistentAttribute, ? extends AttributeMapping>>( - getOrmAttributeMappingUiDefinitions()); - } - - protected synchronized OrmAttributeMappingUiDefinition<? extends AttributeMapping>[] getOrmAttributeMappingUiDefinitions() { - if (this.ormAttributeMappingUiDefinitions == null) { - this.ormAttributeMappingUiDefinitions = this.buildOrmAttributeMappingUiDefinitions(); - } - return this.ormAttributeMappingUiDefinitions; - } - - /** - * Return an array of mapping definitions to use for attributes in mapping files of this type. - * The order is unimportant. - */ - protected OrmAttributeMappingUiDefinition<? extends AttributeMapping>[] buildOrmAttributeMappingUiDefinitions() { - ArrayList<OrmAttributeMappingUiDefinition<? extends AttributeMapping>> definitions = new ArrayList<OrmAttributeMappingUiDefinition<? extends AttributeMapping>>(); - this.addOrmAttributeMappingUiDefinitionsTo(definitions); - @SuppressWarnings("unchecked") - OrmAttributeMappingUiDefinition<? extends AttributeMapping>[] definitionArray = definitions.toArray(new OrmAttributeMappingUiDefinition[definitions.size()]); - return definitionArray; - } - - protected abstract void addOrmAttributeMappingUiDefinitionsTo( - List<OrmAttributeMappingUiDefinition<? extends AttributeMapping>> definitions); - - public DefaultMappingUiDefinition<ReadOnlyPersistentAttribute, ? extends AttributeMapping> getDefaultAttributeMappingUiDefinition(String key) { - return null; - } -} diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/AddGeneratorDialog.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/AddGeneratorDialog.java deleted file mode 100644 index 25619e5913..0000000000 --- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/AddGeneratorDialog.java +++ /dev/null @@ -1,194 +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.ui.internal.details.orm; - -import java.util.ArrayList; -import java.util.List; - -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.core.context.persistence.PersistenceUnit; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.swt.widgets.Text; - -/** - * Clients can use this dialog to prompt the user for SecondaryTable settings. - * Use the following once the dialog is closed: - * @see #getSelectedTable() - * @see #getSelectedCatalog() - * @see #getSelectedSchema() - * @version 2.1 - * @since 2.1 - */ -public class AddGeneratorDialog extends ValidatingDialog<AddGeneratorStateObject> { - public static final String SEQUENCE_GENERATOR = "sequenceGenerator"; //$NON-NLS-1$ - public static final String TABLE_GENERATOR = "tableGenerator"; //$NON-NLS-1$ - - /** - * The associated persistence unit - */ - private PersistenceUnit pUnit; - - // ********** constructors ********** - - /** - * Use this constructor to edit an existing conversion value - */ - public AddGeneratorDialog(Shell parent, PersistenceUnit pUnit) { - super(parent); - this.pUnit = pUnit; - } - - @Override - protected AddGeneratorStateObject buildStateObject() { - return new AddGeneratorStateObject(this.pUnit); - } - - // ********** open ********** - - @Override - protected void configureShell(Shell shell) { - super.configureShell(shell); - shell.setText(this.getTitle()); - } - - @Override - protected String getTitle() { - return JptUiDetailsOrmMessages.AddGeneratorDialog_title; - } - - @Override - protected String getDescriptionTitle() { - return JptUiDetailsOrmMessages.AddGeneratorDialog_descriptionTitle; - } - - @Override - protected String getDescription() { - return JptUiDetailsOrmMessages.AddGeneratorDialog_description; - } - - @Override - protected DialogPane<AddGeneratorStateObject> buildLayout(Composite container) { - return new GeneratorDialogPane(container); - } - - @Override - public void create() { - super.create(); - - GeneratorDialogPane pane = (GeneratorDialogPane) 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 String getGeneratorType() { - return getSubject().getGeneratorType(); - } - - private class GeneratorDialogPane extends DialogPane<AddGeneratorStateObject> { - - private Text nameText; - - GeneratorDialogPane(Composite parent) { - super(AddGeneratorDialog.this.getSubjectHolder(), parent); - } - - @Override - protected void initializeLayout(Composite container) { - this.nameText = addLabeledText( - container, - JptUiDetailsOrmMessages.AddGeneratorDialog_name, - buildNameHolder() - ); - - addLabeledCombo( - container, - JptUiDetailsOrmMessages.AddGeneratorDialog_generatorType, - buildGeneratorTypeListHolder(), - buildGeneratorTypeHolder(), - buildStringConverter(), - null); - } - - protected ListValueModel<String> buildGeneratorTypeListHolder() { - List<String> generatorTypes = new ArrayList<String>(); - generatorTypes.add(TABLE_GENERATOR); - generatorTypes.add(SEQUENCE_GENERATOR); - - return new StaticListValueModel<String>(generatorTypes); - } - - private StringConverter<String> buildStringConverter() { - return new StringConverter<String>() { - public String convertToString(String value) { - if (value == TABLE_GENERATOR) { - return JptUiDetailsOrmMessages.AddGeneratorDialog_tableGenerator; - } - if (value == SEQUENCE_GENERATOR) { - return JptUiDetailsOrmMessages.AddGeneratorDialog_sequenceGenerator; - } - return value; - } - }; - } - - private WritablePropertyValueModel<String> buildNameHolder() { - return new PropertyAspectAdapter<AddGeneratorStateObject, String>(getSubjectHolder(), AddGeneratorStateObject.NAME_PROPERTY) { - @Override - protected String buildValue_() { - return this.subject.getName(); - } - - @Override - protected void setValue_(String value) { - this.subject.setName(value); - } - }; - } - - private WritablePropertyValueModel<String> buildGeneratorTypeHolder() { - return new PropertyAspectAdapter<AddGeneratorStateObject, String>(getSubjectHolder(), AddGeneratorStateObject.GENERATOR_TYPE_PROPERTY) { - @Override - protected String buildValue_() { - return this.subject.getGeneratorType(); - } - - @Override - protected void setValue_(String value) { - this.subject.setGeneratorType(value); - } - }; - } - - void selectAll() { - this.nameText.selectAll(); - } - } -} diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/AddGeneratorStateObject.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/AddGeneratorStateObject.java deleted file mode 100644 index 31b092782d..0000000000 --- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/AddGeneratorStateObject.java +++ /dev/null @@ -1,146 +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.ui.internal.details.orm; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; -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.core.context.Generator; -import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit; - -/** - * This is the state object used by the <code>AddGeneratorDialog</code>, which stores - * the current name and validates it when it is modified. - * - * @see AddGeneratorDialog - * - * @version 2.1 - * @since 2.1 - */ -final class AddGeneratorStateObject extends AbstractNode -{ - /** - * The initial name or <code>null</code> - */ - private String name; - - /** - * The initial generatorType or <code>null</code> - */ - private String generatorType; - - /** - * The <code>Validator</code> used to validate this state object. - */ - private Validator validator; - - /** - * The associated persistence unit - */ - private PersistenceUnit pUnit; - - /** - * Notifies a change in the data value property. - */ - static final String NAME_PROPERTY = "nameProperty"; //$NON-NLS-1$ - - /** - * Notifies a change in the generator type property. - */ - static final String GENERATOR_TYPE_PROPERTY = "generatorTypeProperty"; //$NON-NLS-1$ - - /** - * Creates a new <code>NewNameStateObject</code>. - * - * @param name The initial input or <code>null</code> if no initial value can - * be specified - * @param names The collection of names that can't be used or an empty - * collection if none are available - */ - AddGeneratorStateObject(PersistenceUnit pUnit) { - super(null); - this.pUnit = pUnit; - } - - private void addNameProblemsTo(List<Problem> currentProblems) { - if (StringTools.stringIsEmpty(this.name)) { - currentProblems.add(buildProblem(JptUiDetailsOrmMessages.GeneratorStateObject_nameMustBeSpecified, IMessageProvider.ERROR)); - } - else if (names().contains(this.name)){ - currentProblems.add(buildProblem(JptUiDetailsOrmMessages.GeneratorStateObject_nameExists, IMessageProvider.WARNING)); - } - } - - private void addGeneratorTypeProblemsTo(List<Problem> currentProblems) { - if (StringTools.stringIsEmpty(this.generatorType)) { - currentProblems.add(buildProblem(JptUiDetailsOrmMessages.GeneratorStateObject_typeMustBeSpecified, IMessageProvider.ERROR)); - } - } - - @Override - protected void addProblemsTo(List<Problem> currentProblems) { - super.addProblemsTo(currentProblems); - addNameProblemsTo(currentProblems); - addGeneratorTypeProblemsTo(currentProblems); - } - - private List<String> names() { - List<String> names = new ArrayList<String>(); - for (Iterator<Generator> generators = this.pUnit.generators(); generators.hasNext();){ - String name = generators.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; - } - - String getGeneratorType() { - return this.generatorType; - } - - public void setName(String newName) { - String oldName = this.name; - this.name = newName; - firePropertyChanged(NAME_PROPERTY, oldName, newName); - } - - public void setGeneratorType(String newGeneratorType) { - String old = this.generatorType; - this.generatorType = newGeneratorType; - firePropertyChanged(GENERATOR_TYPE_PROPERTY, old, newGeneratorType); - } - - @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.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/BaseOrmXmlUiFactory.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/BaseOrmXmlUiFactory.java deleted file mode 100644 index d44d8d6e49..0000000000 --- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/BaseOrmXmlUiFactory.java +++ /dev/null @@ -1,134 +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.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.OrmEmbeddedIdMapping; -import org.eclipse.jpt.jpa.core.context.orm.OrmEmbeddedMapping; -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.details.orm.OrmXmlUiFactory; -import org.eclipse.jpt.jpa.ui.internal.details.TransientMappingComposite; -import org.eclipse.swt.widgets.Composite; - -/** - * The default implementation of the Orm Xml UI factory required to show the information - * related to a JPA mapping (type or attribute). - */ -public abstract class BaseOrmXmlUiFactory implements OrmXmlUiFactory -{ - - // **************** orm type mapping composites **************************** - - public JpaComposite createOrmMappedSuperclassComposite( - PropertyValueModel<OrmMappedSuperclass> subjectHolder, - Composite parent, - WidgetFactory widgetFactory) { - return new OrmMappedSuperclassComposite(subjectHolder, parent, widgetFactory); - } - - public JpaComposite createOrmEntityComposite( - PropertyValueModel<OrmEntity> subjectHolder, - Composite parent, - WidgetFactory widgetFactory) { - return new OrmEntityComposite(subjectHolder, parent, widgetFactory); - } - - public JpaComposite createOrmEmbeddableComposite( - PropertyValueModel<OrmEmbeddable> subjectHolder, - Composite parent, - WidgetFactory widgetFactory) { - return new OrmEmbeddableComposite(subjectHolder, parent, widgetFactory); - } - - - // **************** orm attribute mapping composites *********************** - - public JpaComposite createOrmIdMappingComposite( - PropertyValueModel<OrmIdMapping> subjectHolder, - Composite parent, - WidgetFactory widgetFactory) { - return new OrmIdMappingComposite(subjectHolder, parent, widgetFactory); - } - - public JpaComposite createOrmEmbeddedIdMappingComposite( - PropertyValueModel<OrmEmbeddedIdMapping> subjectHolder, - Composite parent, - WidgetFactory widgetFactory) { - return new OrmEmbeddedIdMappingComposite(subjectHolder, parent, widgetFactory); - } - - public JpaComposite createOrmBasicMappingComposite( - PropertyValueModel<OrmBasicMapping> subjectHolder, - Composite parent, - WidgetFactory widgetFactory) { - return new OrmBasicMappingComposite(subjectHolder, parent, widgetFactory); - } - - public JpaComposite createOrmVersionMappingComposite( - PropertyValueModel<OrmVersionMapping> subjectHolder, - Composite parent, - WidgetFactory widgetFactory) { - return new OrmVersionMappingComposite(subjectHolder, parent, widgetFactory); - } - - public JpaComposite createOrmManyToOneMappingComposite( - PropertyValueModel<OrmManyToOneMapping> subjectHolder, - Composite parent, - WidgetFactory widgetFactory) { - return new OrmManyToOneMappingComposite(subjectHolder, parent, widgetFactory); - } - - public JpaComposite createOrmOneToManyMappingComposite( - PropertyValueModel<OrmOneToManyMapping> subjectHolder, - Composite parent, - WidgetFactory widgetFactory) { - return new OrmOneToManyMappingComposite(subjectHolder, parent, widgetFactory); - } - - public JpaComposite createOrmOneToOneMappingComposite( - PropertyValueModel<OrmOneToOneMapping> subjectHolder, - Composite parent, - WidgetFactory widgetFactory) { - return new OrmOneToOneMappingComposite(subjectHolder, parent, widgetFactory); - } - - public JpaComposite createOrmManyToManyMappingComposite( - PropertyValueModel<OrmManyToManyMapping> subjectHolder, - Composite parent, - WidgetFactory widgetFactory) { - return new OrmManyToManyMappingComposite(subjectHolder, parent, widgetFactory); - } - - public JpaComposite createOrmEmbeddedMappingComposite( - PropertyValueModel<OrmEmbeddedMapping> subjectHolder, - Composite parent, - WidgetFactory widgetFactory) { - return new OrmEmbeddedMappingComposite(subjectHolder, parent, widgetFactory); - } - - 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.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/EntityMappingsDetailsPage.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/EntityMappingsDetailsPage.java deleted file mode 100644 index 0c9ec4c6df..0000000000 --- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/EntityMappingsDetailsPage.java +++ /dev/null @@ -1,82 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2009 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.jpa.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.swt.widgets.Composite; - -/** - * Here the layout of this pane: - * <pre> - * ----------------------------------------------------------------------------- - * | ------------------------------------------------------------------------- | - * | | | | - * | | XmlPackageChooser | | - * | | | | - * | ------------------------------------------------------------------------- | - * | ------------------------------------------------------------ | - * | Schema: | SchemaCombo | | - * | ------------------------------------------------------------ | - * | ------------------------------------------------------------ | - * | Catalog: | CatalogCombo | | - * | ------------------------------------------------------------ | - * | ------------------------------------------------------------ | - * | Access Type: | |v| | - * | ------------------------------------------------------------ | - * | | - * | ------------------------------------------------------------------------- | - * | | | | - * | | PersistenceUnitMetadataComposite | | - * | | | | - * | ------------------------------------------------------------------------- | - * | ------------------------------------------------------------------------- | - * | | | | - * | | OrmGeneratorsComposite | | - * | | | | - * | ------------------------------------------------------------------------- | - * | ------------------------------------------------------------------------- | - * | | | | - * | | OrmQueriesComposite | | - * | | | | - * | ------------------------------------------------------------------------- | - * -----------------------------------------------------------------------------</pre> - * - * @see EntityMappings - * @see EntityMappingsDetailsPage - The parent container - * @see CatalogCombo - * @see EnumFormComboViewer - * @see EntityMappingsGeneratorsComposite - * @see OrmPackageChooser - * @see OrmQueriesComposite - * @see PersistenceUnitMetadataComposite - * @see SchemaCombo - * - * @version 2.2 - * @since 2.0 - */ -public class EntityMappingsDetailsPage extends AbstractEntityMappingsDetailsPage -{ - /** - * Creates a new <code>EntityMappingsDetailsPage</code>. - * - * @param parent The parent container - * @param widgetFactory The factory used to create various common widgets - */ - public EntityMappingsDetailsPage(Composite parent, - WidgetFactory widgetFactory) { - - super(parent, widgetFactory); - } - -}
\ No newline at end of file diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/EntityMappingsDetailsProvider.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/EntityMappingsDetailsProvider.java deleted file mode 100644 index 0d9435573c..0000000000 --- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/EntityMappingsDetailsProvider.java +++ /dev/null @@ -1,60 +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.ui.internal.details.orm; - -import org.eclipse.jpt.common.core.JptResourceType; -import org.eclipse.jpt.common.ui.WidgetFactory; -import org.eclipse.jpt.jpa.core.JptJpaCorePlugin; -import org.eclipse.jpt.jpa.core.context.orm.EntityMappings; -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). - */ -public class EntityMappingsDetailsProvider - extends AbstractEntityMappingsDetailsProvider -{ - // singleton - private static final JpaDetailsProvider INSTANCE = new EntityMappingsDetailsProvider(); - - - /** - * Return the singleton - */ - public static JpaDetailsProvider instance() { - return INSTANCE; - } - - - /** - * Enforce singleton usage - */ - private EntityMappingsDetailsProvider() { - super(); - } - - - @Override - protected boolean providesDetails(JptResourceType resourceType) { - return resourceType.equals(JptJpaCorePlugin.ORM_XML_1_0_RESOURCE_TYPE); - } - - public JpaDetailsPage<EntityMappings> buildDetailsPage( - Composite parent, - WidgetFactory widgetFactory) { - - return new EntityMappingsDetailsPage(parent, widgetFactory); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/EntityMappingsGeneratorsComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/EntityMappingsGeneratorsComposite.java deleted file mode 100644 index 0519124a20..0000000000 --- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/EntityMappingsGeneratorsComposite.java +++ /dev/null @@ -1,371 +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.ui.internal.details.orm; - -import java.util.ArrayList; -import java.util.List; - -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.util.PaneEnabler; -import org.eclipse.jpt.common.ui.internal.widgets.AddRemoveListPane; -import org.eclipse.jpt.common.ui.internal.widgets.Pane; -import org.eclipse.jpt.common.ui.internal.widgets.AddRemovePane.Adapter; -import org.eclipse.jpt.common.utility.internal.CollectionTools; -import org.eclipse.jpt.common.utility.internal.Transformer; -import org.eclipse.jpt.common.utility.internal.iterables.ListIterable; -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.JpaNamedContextNode; -import org.eclipse.jpt.jpa.core.context.SequenceGenerator; -import org.eclipse.jpt.jpa.core.context.TableGenerator; -import org.eclipse.jpt.jpa.core.context.orm.EntityMappings; -import org.eclipse.jpt.jpa.core.context.orm.OrmGenerator; -import org.eclipse.jpt.jpa.core.context.orm.OrmSequenceGenerator; -import org.eclipse.jpt.jpa.core.context.orm.OrmTableGenerator; -import org.eclipse.jpt.jpa.ui.internal.details.GeneratorComposite; -import org.eclipse.jpt.jpa.ui.internal.details.SequenceGeneratorComposite; -import org.eclipse.jpt.jpa.ui.internal.details.TableGeneratorComposite; -import org.eclipse.jpt.jpa.ui.internal.details.GeneratorComposite.GeneratorBuilder; -import org.eclipse.osgi.util.NLS; -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 | | - * | | | | - * | ------------------------------------------------------------------------- | - * | ------------------------------------------------------------------------- | - * | | | | - * | | OrmSequenceGeneratorComposite or OrmTableGeneratorComposite | | - * | | | | - * | ------------------------------------------------------------------------- | - * -----------------------------------------------------------------------------</pre> - * - * @see EntityMappings - * @see OrmGenerator - * @see OrmSequenceGenerator - * @see OrmTableGenerator - * @see EntityComposite - The parent container - * @see OrmSequenceGeneratorComposite - * @see OrmTableGeneratorComposite - * - * @version 2.2 - * @since 2.0 - */ -public class EntityMappingsGeneratorsComposite extends Pane<EntityMappings> -{ - private WritablePropertyValueModel<OrmGenerator> generatorHolder; - GeneratorComposite<SequenceGenerator> sequenceGeneratorPane; - TableGeneratorComposite tableGeneratorPane; - private AddRemoveListPane<EntityMappings> listPane; - - /** - * Creates a new <code>EntityMappingsGeneratorsComposite</code>. - * - * @param parentPane The parent container of this one - * @param parent The parent container - */ - public EntityMappingsGeneratorsComposite( - Pane<? extends EntityMappings> parentPane, - Composite parent) { - - super(parentPane, parent, false); - } - - void addGenerator(ObjectListSelectionModel listSelectionModel) { - addGeneratorFromDialog(listSelectionModel, buildAddGeneratorDialog()); - } - - protected AddGeneratorDialog buildAddGeneratorDialog() { - return new AddGeneratorDialog(getShell(), this.getSubject().getPersistenceUnit()); - } - - protected void addGeneratorFromDialog(ObjectListSelectionModel listSelectionModel, AddGeneratorDialog dialog) { - if (dialog.open() != Window.OK) { - return; - } - String generatorType = dialog.getGeneratorType(); - OrmGenerator generator; - if (generatorType == AddGeneratorDialog.TABLE_GENERATOR) { - generator = this.getSubject().addTableGenerator(); - } - else if (generatorType == AddGeneratorDialog.SEQUENCE_GENERATOR) { - generator = this.getSubject().addSequenceGenerator(); - } - else { - throw new IllegalArgumentException(); - } - generator.setName(dialog.getName()); - this.generatorHolder.setValue(generator);//so that it gets selected in the List for the user to edit - listSelectionModel.setSelectedValue(generator); - } - - private ListValueModel<OrmGenerator> buildDisplayableGeneratorListHolder() { - return new ItemPropertyListValueModelAdapter<OrmGenerator>( - buildGeneratorsListHolder(), - JpaNamedContextNode.NAME_PROPERTY - ); - } - - private Adapter buildGeneratorAdapter() { - - return new AddRemoveListPane.AbstractAdapter() { - - public void addNewItem(ObjectListSelectionModel listSelectionModel) { - addGenerator(listSelectionModel); - } - - - public void removeSelectedItems(ObjectListSelectionModel listSelectionModel) { - for (Object item : listSelectionModel.selectedValues()) { - if (item instanceof OrmSequenceGenerator) { - getSubject().removeSequenceGenerator((OrmSequenceGenerator) item); - } - else { - getSubject().removeTableGenerator((OrmTableGenerator) item); - } - } - } - }; - } - - private WritablePropertyValueModel<OrmGenerator> buildGeneratorHolder() { - return new SimplePropertyValueModel<OrmGenerator>(); - } - - private ILabelProvider buildGeneratorLabelProvider() { - return new LabelProvider() { - @Override - public String getText(Object element) { - OrmGenerator generator = (OrmGenerator) element; - String name = generator.getName(); - - if (name == null) { - int index = -1; - - if (generator instanceof OrmSequenceGenerator) { - index = CollectionTools.indexOf(getSubject().getSequenceGenerators(), generator); - } - else { - index = CollectionTools.indexOf(getSubject().getTableGenerators(), generator); - } - - name = NLS.bind(JptUiDetailsOrmMessages.OrmGeneratorsComposite_displayString, Integer.valueOf(index)); - } - - return name; - } - }; - } - - private ListValueModel<OrmGenerator> buildGeneratorsListHolder() { - List<ListValueModel<? extends OrmGenerator>> list = new ArrayList<ListValueModel<? extends OrmGenerator>>(); - list.add(buildSequenceGeneratorListHolder()); - list.add(buildTableGeneratorListHolder()); - return new CompositeListValueModel<ListValueModel<? extends OrmGenerator>, OrmGenerator>(list); - } - - private PropertyValueModel<Boolean> buildPaneEnablerHolder() { - return new TransformationPropertyValueModel<EntityMappings, Boolean>(getSubjectHolder()) { - @Override - protected Boolean transform(EntityMappings value) { - return Boolean.valueOf(value != null); - } - }; - } - - private Transformer<OrmGenerator, Control> buildPaneTransformer() { - return new Transformer<OrmGenerator, Control>() { - public Control transform(OrmGenerator generator) { - - if (generator == null) { - return null; - } - - if (generator instanceof OrmSequenceGenerator) { - return EntityMappingsGeneratorsComposite.this.sequenceGeneratorPane.getControl(); - } - - return EntityMappingsGeneratorsComposite.this.tableGeneratorPane.getControl(); - } - }; - } - - private PropertyValueModel<SequenceGenerator> buildSequenceGeneratorHolder() { - return new TransformationPropertyValueModel<OrmGenerator, SequenceGenerator>(this.generatorHolder) { - @Override - protected SequenceGenerator transform_(OrmGenerator value) { - return (value instanceof SequenceGenerator) ? (SequenceGenerator) value : null; - } - }; - } - - private ListValueModel<OrmSequenceGenerator> buildSequenceGeneratorListHolder() { - return new ListAspectAdapter<EntityMappings, OrmSequenceGenerator>( - getSubjectHolder(), - EntityMappings.SEQUENCE_GENERATORS_LIST) - { - @Override - protected ListIterable<OrmSequenceGenerator> getListIterable() { - return this.subject.getSequenceGenerators(); - } - @Override - protected int size_() { - return this.subject.getSequenceGeneratorsSize(); - } - }; - } - - private PropertyValueModel<TableGenerator> buildTableGeneratorHolder() { - return new TransformationPropertyValueModel<OrmGenerator, TableGenerator>(this.generatorHolder) { - @Override - protected TableGenerator transform_(OrmGenerator value) { - return (value instanceof TableGenerator) ? (TableGenerator) value : null; - } - }; - } - - private ListValueModel<OrmTableGenerator> buildTableGeneratorListHolder() { - return new ListAspectAdapter<EntityMappings, OrmTableGenerator>( - getSubjectHolder(), - EntityMappings.TABLE_GENERATORS_LIST) - { - @Override - protected ListIterable<OrmTableGenerator> getListIterable() { - return this.subject.getTableGenerators(); - } - @Override - protected int size_() { - return this.subject.getTableGeneratorsSize(); - } - }; - } - - - @Override - protected void initialize() { - super.initialize(); - this.generatorHolder = buildGeneratorHolder(); - } - - @Override - protected void initializeLayout(Composite container) { - - container = addCollapsibleSection( - container, - JptUiDetailsOrmMessages.OrmGeneratorsComposite_groupBox - ); - - // List pane - this.listPane = addListPane(container); - this.installPaneEnabler(); - - // Property pane - PropertyValueModel<SequenceGenerator> sequenceGeneratorHolder = - this.buildSequenceGeneratorHolder(); - PropertyValueModel<TableGenerator> tableGeneratorHolder = - this.buildTableGeneratorHolder(); - - PageBook pageBook = new PageBook(container, SWT.NULL); - pageBook.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - - // Sequence Generator property pane - this.sequenceGeneratorPane = this.buildSequenceGeneratorComposite( - pageBook, - sequenceGeneratorHolder, - this.buildSequenceGeneratorBuilder() - ); - - // Table Generator property pane - this.tableGeneratorPane = new TableGeneratorComposite( - this, - tableGeneratorHolder, - pageBook, - this.buildTableGeneratorBuilder() - ); - - this.addAlignRight(this.sequenceGeneratorPane); - this.addAlignRight(this.tableGeneratorPane); - this.installPaneSwitcher(pageBook); - } - - protected GeneratorComposite<SequenceGenerator> buildSequenceGeneratorComposite( - Composite parent, - PropertyValueModel<SequenceGenerator> sequenceGeneratorHolder, - GeneratorBuilder<SequenceGenerator> generatorBuilder) { - - return new SequenceGeneratorComposite( - this, - sequenceGeneratorHolder, - parent, - generatorBuilder - ); - } - - private AddRemoveListPane<EntityMappings> addListPane(Composite container) { - - return new AddRemoveListPane<EntityMappings>( - this, - container, - this.buildGeneratorAdapter(), - this.buildDisplayableGeneratorListHolder(), - this.generatorHolder, - this.buildGeneratorLabelProvider() - ); - } - - private void installPaneEnabler() { - new PaneEnabler( - this.buildPaneEnablerHolder(), - this.listPane - ); - } - - private void installPaneSwitcher(PageBook pageBook) { - new ControlSwitcher(this.generatorHolder, this.buildPaneTransformer(), pageBook); - } - - private GeneratorBuilder<SequenceGenerator> buildSequenceGeneratorBuilder() { - return new GeneratorBuilder<SequenceGenerator>() { - public SequenceGenerator addGenerator() { - throw new UnsupportedOperationException("The sequence generator will never be null so we do not need to implement this"); //$NON-NLS-1$ - } - }; - } - - private GeneratorBuilder<TableGenerator> buildTableGeneratorBuilder() { - return new GeneratorBuilder<TableGenerator>() { - public TableGenerator addGenerator() { - throw new UnsupportedOperationException("The table generator will never be null so we do not need to implement this"); //$NON-NLS-1$ - } - }; - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/GenericOrmXmlUiFactory.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/GenericOrmXmlUiFactory.java deleted file mode 100644 index 5ea741c22d..0000000000 --- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/GenericOrmXmlUiFactory.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.ui.internal.details.orm; - -public class GenericOrmXmlUiFactory extends BaseOrmXmlUiFactory -{ - //nothing -} diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/JptUiDetailsOrmMessages.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/JptUiDetailsOrmMessages.java deleted file mode 100644 index e2db1608ce..0000000000 --- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/JptUiDetailsOrmMessages.java +++ /dev/null @@ -1,76 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2010 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.jpa.ui.internal.details.orm; - -import org.eclipse.osgi.util.NLS; - -/** - * Localized messages used by Dali ORM widgets. - * - * @version 2.2 - * @since 1.0 - */ -public class JptUiDetailsOrmMessages { - - public static String EntityMappingsSection_title; - public static String EntityMappingsDetailsPage_access; - public static String EntityMappingsDetailsPage_catalog; - public static String EntityMappingsDetailsPage_field; - public static String EntityMappingsDetailsPage_package; - public static String EntityMappingsDetailsPage_property; - public static String EntityMappingsDetailsPage_schema; - public static String EntityMappingsPage_catalogDefault; - public static String EntityMappingsPage_catalogNoDefaultSpecified; - public static String EntityMappingsPage_schemaDefault; - public static String EntityMappingsPage_schemaNoDefaultSpecified; - public static String MetadataCompleteComposite_metadataComplete; - public static String MetadataCompleteComposite_metadataCompleteWithDefault; - public static String OrmGeneratorsComposite_displayString; - public static String OrmGeneratorsComposite_groupBox; - public static String OrmMappingNameChooser_name; - public static String OrmJavaClassChooser_javaClass; - public static String OrmQueriesComposite_groupBox; - public static String PersistenceUnitMetadataComposite_access; - public static String PersistenceUnitMetadataComposite_delimitedIdentifiersCheckBox; - public static String PersistenceUnitMetadataComposite_cascadePersistCheckBox; - public static String PersistenceUnitMetadataComposite_catalog; - public static String PersistenceUnitMetadataComposite_field; - public static String PersistenceUnitMetadataComposite_persistenceUnitSection; - public static String PersistenceUnitMetadataComposite_property; - public static String PersistenceUnitMetadataComposite_schema; - public static String PersistenceUnitMetadataComposite_xmlMappingMetadataCompleteCheckBox; - public static String PersistenceUnitMetadataSection_catalogDefault; - public static String PersistenceUnitMetadataSection_schemaDefault; - - public static String AddGeneratorDialog_name; - public static String AddGeneratorDialog_generatorType; - public static String AddGeneratorDialog_title; - public static String AddGeneratorDialog_descriptionTitle; - public static String AddGeneratorDialog_description; - public static String AddGeneratorDialog_tableGenerator; - public static String AddGeneratorDialog_sequenceGenerator; - public static String GeneratorStateObject_nameExists; - public static String GeneratorStateObject_nameMustBeSpecified; - public static String GeneratorStateObject_typeMustBeSpecified; - - public static String UnsupportedOrmMappingUiProvider_label; - public static String UnsupportedOrmMappingUiProvider_linkLabel; - - private static final String BUNDLE_NAME = "jpt_ui_details_orm"; //$NON-NLS-1$ - private static final Class<?> BUNDLE_CLASS = JptUiDetailsOrmMessages.class; - static { - NLS.initializeMessages(BUNDLE_NAME, BUNDLE_CLASS); - } - - private JptUiDetailsOrmMessages() { - throw new UnsupportedOperationException(); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/MetadataCompleteComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/MetadataCompleteComposite.java deleted file mode 100644 index 62d4f60ce5..0000000000 --- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/MetadataCompleteComposite.java +++ /dev/null @@ -1,89 +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.ui.internal.details.orm; - -import org.eclipse.jpt.common.ui.internal.JptCommonUiMessages; -import org.eclipse.jpt.common.ui.internal.widgets.Pane; -import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter; -import org.eclipse.jpt.common.utility.internal.model.value.TransformationPropertyValueModel; -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.orm.OrmTypeMapping; -import org.eclipse.osgi.util.NLS; -import org.eclipse.swt.widgets.Composite; - -public class MetadataCompleteComposite extends Pane<OrmTypeMapping> { - - public MetadataCompleteComposite(Pane<?> parentPane, - PropertyValueModel<? extends OrmTypeMapping> subjectHolder, - Composite parent) { - - super(parentPane, subjectHolder, parent); - } - - @Override - protected void initializeLayout(Composite container) { - - // TODO not sure the is the right thing to do; since metadata complete - // has an "override" (from the persistence unit), not a default... - addTriStateCheckBoxWithDefault( - container, - JptUiDetailsOrmMessages.MetadataCompleteComposite_metadataComplete, - buildMetadataCompleteHolder(), - buildMetadataCompleteStringHolder(), - null - ); - } - - private WritablePropertyValueModel<Boolean> buildMetadataCompleteHolder() { - return new PropertyAspectAdapter<OrmTypeMapping, Boolean>( - getSubjectHolder(), - OrmTypeMapping.SPECIFIED_METADATA_COMPLETE_PROPERTY) - { - @Override - protected Boolean buildValue_() { - return this.subject.getSpecifiedMetadataComplete(); - } - - @Override - protected void setValue_(Boolean value) { - this.subject.setSpecifiedMetadataComplete(value); - } - }; - } - - private PropertyValueModel<String> buildMetadataCompleteStringHolder() { - return new TransformationPropertyValueModel<Boolean, String>(buildOverrideMetadataCompleteHolder()) { - @Override - protected String transform(Boolean value) { - if (value != null) { - String defaultStringValue = value.booleanValue() ? JptCommonUiMessages.Boolean_True : JptCommonUiMessages.Boolean_False; - return NLS.bind(JptUiDetailsOrmMessages.MetadataCompleteComposite_metadataCompleteWithDefault, defaultStringValue); - } - return JptUiDetailsOrmMessages.MetadataCompleteComposite_metadataComplete; - } - }; - } - private PropertyValueModel<Boolean> buildOverrideMetadataCompleteHolder() { - return new PropertyAspectAdapter<OrmTypeMapping, Boolean>( - getSubjectHolder(), - OrmTypeMapping.SPECIFIED_METADATA_COMPLETE_PROPERTY, - OrmTypeMapping.OVERRIDE_METADATA_COMPLETE_PROPERTY) - { - @Override - protected Boolean buildValue_() { - if (this.subject.getSpecifiedMetadataComplete() != null) { - return null; - } - return Boolean.valueOf(this.subject.isOverrideMetadataComplete()); - } - }; - } -}
\ No newline at end of file diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmBasicMappingComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmBasicMappingComposite.java deleted file mode 100644 index 60f453b983..0000000000 --- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmBasicMappingComposite.java +++ /dev/null @@ -1,45 +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.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.BasicMapping; -import org.eclipse.jpt.jpa.ui.internal.details.AbstractBasicMappingComposite; -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.swt.widgets.Composite; - -public class OrmBasicMappingComposite extends AbstractBasicMappingComposite<BasicMapping> -{ - /** - * Creates a new <code>EclipseLink1_1OrmBasicMappingComposite</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 OrmBasicMappingComposite(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)); - } - -}
\ No newline at end of file diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmBasicMappingUiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmBasicMappingUiDefinition.java deleted file mode 100644 index febf82f355..0000000000 --- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmBasicMappingUiDefinition.java +++ /dev/null @@ -1,54 +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.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.core.context.orm.OrmBasicMapping; -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.jpt.jpa.ui.internal.details.AbstractBasicMappingUiDefinition; -import org.eclipse.swt.widgets.Composite; - -public class OrmBasicMappingUiDefinition - extends AbstractBasicMappingUiDefinition<ReadOnlyPersistentAttribute, OrmBasicMapping> - implements OrmAttributeMappingUiDefinition<OrmBasicMapping> -{ - // singleton - private static final OrmBasicMappingUiDefinition INSTANCE = - new OrmBasicMappingUiDefinition(); - - /** - * Return the singleton. - */ - public static OrmAttributeMappingUiDefinition<OrmBasicMapping> instance() { - return INSTANCE; - } - - - /** - * Ensure single instance. - */ - private OrmBasicMappingUiDefinition() { - super(); - } - - public JpaComposite buildAttributeMappingComposite( - OrmXmlUiFactory factory, - PropertyValueModel<OrmBasicMapping> subjectHolder, - Composite parent, - WidgetFactory widgetFactory) { - - return factory.createOrmBasicMappingComposite(subjectHolder, parent, widgetFactory); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmEmbeddableComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmEmbeddableComposite.java deleted file mode 100644 index 6717dbe577..0000000000 --- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmEmbeddableComposite.java +++ /dev/null @@ -1,54 +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.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.orm.OrmEmbeddable; -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.swt.widgets.Composite; - -public class OrmEmbeddableComposite extends AbstractEmbeddableComposite<OrmEmbeddable> implements JpaComposite -{ - public OrmEmbeddableComposite(PropertyValueModel<? extends OrmEmbeddable> subjectHolder, - Composite parent, - WidgetFactory widgetFactory) { - - super(subjectHolder, parent, widgetFactory); - } - - @Override - protected void initializeLayout(Composite container) { - this.initializeEmbeddableCollapsibleSection(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<OrmEmbeddable, AccessHolder>( - getSubjectHolder()) - { - @Override - protected AccessHolder buildValue_() { - return this.subject.getPersistentType(); - } - }; - } - -}
\ No newline at end of file diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmEmbeddableUiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmEmbeddableUiDefinition.java deleted file mode 100644 index 9d611ac30e..0000000000 --- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmEmbeddableUiDefinition.java +++ /dev/null @@ -1,54 +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.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.PersistentType; -import org.eclipse.jpt.jpa.core.context.orm.OrmEmbeddable; -import org.eclipse.jpt.jpa.ui.details.JpaComposite; -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.AbstractEmbeddableUiDefinition; -import org.eclipse.swt.widgets.Composite; - -public class OrmEmbeddableUiDefinition - extends AbstractEmbeddableUiDefinition<PersistentType, OrmEmbeddable> - implements OrmTypeMappingUiDefinition<OrmEmbeddable> -{ - // singleton - private static final OrmEmbeddableUiDefinition INSTANCE = new OrmEmbeddableUiDefinition(); - - - /** - * Return the singleton. - */ - public static OrmTypeMappingUiDefinition<OrmEmbeddable> instance() { - return INSTANCE; - } - - - /** - * Ensure single instance. - */ - private OrmEmbeddableUiDefinition() { - super(); - } - - - public JpaComposite buildTypeMappingComposite( - OrmXmlUiFactory factory, - PropertyValueModel<OrmEmbeddable> subjectHolder, - Composite parent, - WidgetFactory widgetFactory) { - - return factory.createOrmEmbeddableComposite(subjectHolder, parent, widgetFactory); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmEmbeddedIdMappingComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmEmbeddedIdMappingComposite.java deleted file mode 100644 index 939321c5d3..0000000000 --- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmEmbeddedIdMappingComposite.java +++ /dev/null @@ -1,39 +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.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.EmbeddedIdMapping; -import org.eclipse.jpt.jpa.ui.internal.details.AbstractEmbeddedIdMappingComposite; -import org.eclipse.jpt.jpa.ui.internal.details.EmbeddedMappingOverridesComposite; -import org.eclipse.swt.widgets.Composite; - -public class OrmEmbeddedIdMappingComposite - extends AbstractEmbeddedIdMappingComposite<EmbeddedIdMapping> -{ - public OrmEmbeddedIdMappingComposite( - PropertyValueModel<? extends EmbeddedIdMapping> subjectHolder, - Composite parent, - WidgetFactory widgetFactory) { - - super(subjectHolder, parent, widgetFactory); - } - - - @Override - protected void initializeEmbeddedIdSection(Composite container) { - new OrmMappingNameChooser(this, getSubjectHolder(), container); - - new EmbeddedMappingOverridesComposite( - this, - container); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmEmbeddedIdMappingUiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmEmbeddedIdMappingUiDefinition.java deleted file mode 100644 index 9d8a08c1ff..0000000000 --- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmEmbeddedIdMappingUiDefinition.java +++ /dev/null @@ -1,56 +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.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.core.context.orm.OrmEmbeddedIdMapping; -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.jpt.jpa.ui.internal.details.AbstractEmbeddedIdMappingUiDefinition; -import org.eclipse.swt.widgets.Composite; - -public class OrmEmbeddedIdMappingUiDefinition - extends AbstractEmbeddedIdMappingUiDefinition<ReadOnlyPersistentAttribute, OrmEmbeddedIdMapping> - implements OrmAttributeMappingUiDefinition<OrmEmbeddedIdMapping> -{ - // singleton - private static final OrmEmbeddedIdMappingUiDefinition INSTANCE = - new OrmEmbeddedIdMappingUiDefinition(); - - - /** - * Return the singleton. - */ - public static OrmAttributeMappingUiDefinition<OrmEmbeddedIdMapping> instance() { - return INSTANCE; - } - - - /** - * Ensure single instance. - */ - private OrmEmbeddedIdMappingUiDefinition() { - super(); - } - - - public JpaComposite buildAttributeMappingComposite( - OrmXmlUiFactory factory, - PropertyValueModel<OrmEmbeddedIdMapping> subjectHolder, - Composite parent, - WidgetFactory widgetFactory) { - - return factory.createOrmEmbeddedIdMappingComposite(subjectHolder, parent, widgetFactory); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmEmbeddedMappingComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmEmbeddedMappingComposite.java deleted file mode 100644 index 44a45c4e49..0000000000 --- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmEmbeddedMappingComposite.java +++ /dev/null @@ -1,64 +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.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.EmbeddedMapping; -import org.eclipse.jpt.jpa.ui.internal.details.AbstractEmbeddedMappingComposite; -import org.eclipse.jpt.jpa.ui.internal.details.EmbeddedMappingOverridesComposite; -import org.eclipse.jpt.jpa.ui.internal.details.java.BaseJavaUiFactory; -import org.eclipse.swt.widgets.Composite; - -/** - * Here the layout of this pane: - * <pre> - * ----------------------------------------------------------------------------- - * | ------------------------------------------------------------------------- | - * | | | | - * | | EmbeddedAttributeOverridesComposite | | - * | | | | - * | ------------------------------------------------------------------------- | - * -----------------------------------------------------------------------------</pre> - * - * @see EmbeddedMapping - * @see BaseJavaUiFactory - The factory creating this pane - * - * @version 2.3 - * @since 2.2 - */ -public class OrmEmbeddedMappingComposite - extends AbstractEmbeddedMappingComposite<EmbeddedMapping> -{ - /** - * Creates a new <code>EmbeddedMappingComposite</code>. - * - * @param subjectHolder The holder of the subject <code>EmbeddedMapping</code> - * @param parent The parent container - * @param widgetFactory The factory used to create various common widgets - */ - public OrmEmbeddedMappingComposite(PropertyValueModel<? extends EmbeddedMapping> subjectHolder, - Composite parent, - WidgetFactory widgetFactory) { - - super(subjectHolder, parent, widgetFactory); - } - - @Override - protected void initializeEmbeddedSection(Composite container) { - new OrmMappingNameChooser(this, getSubjectHolder(), container); - - new EmbeddedMappingOverridesComposite( - this, - container - ); - } - -}
\ No newline at end of file diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmEmbeddedMappingUiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmEmbeddedMappingUiDefinition.java deleted file mode 100644 index 532f197eb0..0000000000 --- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmEmbeddedMappingUiDefinition.java +++ /dev/null @@ -1,56 +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.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.core.context.orm.OrmEmbeddedMapping; -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.jpt.jpa.ui.internal.details.AbstractEmbeddedMappingUiDefinition; -import org.eclipse.swt.widgets.Composite; - -public class OrmEmbeddedMappingUiDefinition - extends AbstractEmbeddedMappingUiDefinition<ReadOnlyPersistentAttribute, OrmEmbeddedMapping> - implements OrmAttributeMappingUiDefinition<OrmEmbeddedMapping> -{ - // singleton - private static final OrmEmbeddedMappingUiDefinition INSTANCE = - new OrmEmbeddedMappingUiDefinition(); - - - /** - * Return the singleton. - */ - public static OrmAttributeMappingUiDefinition<OrmEmbeddedMapping> instance() { - return INSTANCE; - } - - - /** - * Ensure single instance. - */ - private OrmEmbeddedMappingUiDefinition() { - super(); - } - - - public JpaComposite buildAttributeMappingComposite( - OrmXmlUiFactory factory, - PropertyValueModel<OrmEmbeddedMapping> subjectHolder, - Composite parent, - WidgetFactory widgetFactory) { - - return factory.createOrmEmbeddedMappingComposite(subjectHolder, parent, widgetFactory); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmEntityComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmEntityComposite.java deleted file mode 100644 index ebbbcdbcfd..0000000000 --- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmEntityComposite.java +++ /dev/null @@ -1,43 +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.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; - -/** - * The pane used for an ORM entity. - * - * @see OrmEntity - * @see BaseJavaUiFactory - The factory creating this pane - * @see OrmSecondaryTablesComposite - * - * @version 2.0 - * @since 1.0 - */ -public class OrmEntityComposite extends AbstractOrmEntityComposite -{ - /** - * Creates a new <code>OrmEntityComposite</code>. - * - * @param subjectHolder The holder of the subject <code>OrmEntity</code> - * @param parent The parent container - * @param widgetFactory The factory used to create various common widgets - */ - public OrmEntityComposite(PropertyValueModel<? extends OrmEntity> subjectHolder, - Composite parent, - WidgetFactory widgetFactory) { - - super(subjectHolder, parent, widgetFactory); - } - -}
\ No newline at end of file diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmEntityUiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmEntityUiDefinition.java deleted file mode 100644 index 28ec546536..0000000000 --- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmEntityUiDefinition.java +++ /dev/null @@ -1,55 +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.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.PersistentType; -import org.eclipse.jpt.jpa.core.context.orm.OrmEntity; -import org.eclipse.jpt.jpa.ui.details.JpaComposite; -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.AbstractEntityUiDefinition; -import org.eclipse.swt.widgets.Composite; - -public class OrmEntityUiDefinition - extends AbstractEntityUiDefinition<PersistentType, OrmEntity> - implements OrmTypeMappingUiDefinition<OrmEntity> -{ - // singleton - private static final OrmEntityUiDefinition INSTANCE = - new OrmEntityUiDefinition(); - - - /** - * Return the singleton. - */ - public static OrmTypeMappingUiDefinition<OrmEntity> instance() { - return INSTANCE; - } - - - /** - * Ensure single instance. - */ - private OrmEntityUiDefinition() { - super(); - } - - - public JpaComposite buildTypeMappingComposite( - OrmXmlUiFactory factory, - PropertyValueModel<OrmEntity> subjectHolder, - Composite parent, - WidgetFactory widgetFactory) { - - return factory.createOrmEntityComposite(subjectHolder, parent, widgetFactory); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmIdMappingComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmIdMappingComposite.java deleted file mode 100644 index 83fb1c9850..0000000000 --- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmIdMappingComposite.java +++ /dev/null @@ -1,36 +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.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.IdMapping; -import org.eclipse.jpt.jpa.ui.internal.details.AbstractIdMappingComposite; -import org.eclipse.jpt.jpa.ui.internal.details.ColumnComposite; -import org.eclipse.swt.widgets.Composite; - -public class OrmIdMappingComposite - extends AbstractIdMappingComposite<IdMapping> -{ - public OrmIdMappingComposite( - 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); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmIdMappingUiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmIdMappingUiDefinition.java deleted file mode 100644 index a66e67eba2..0000000000 --- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmIdMappingUiDefinition.java +++ /dev/null @@ -1,56 +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.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.core.context.orm.OrmIdMapping; -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.jpt.jpa.ui.internal.details.AbstractIdMappingUiDefinition; -import org.eclipse.swt.widgets.Composite; - -public class OrmIdMappingUiDefinition - extends AbstractIdMappingUiDefinition<ReadOnlyPersistentAttribute, OrmIdMapping> - implements OrmAttributeMappingUiDefinition<OrmIdMapping> -{ - // singleton - private static final OrmIdMappingUiDefinition INSTANCE = - new OrmIdMappingUiDefinition(); - - - /** - * Return the singleton. - */ - public static OrmAttributeMappingUiDefinition<OrmIdMapping> instance() { - return INSTANCE; - } - - - /** - * Ensure single instance. - */ - private OrmIdMappingUiDefinition() { - super(); - } - - - public JpaComposite buildAttributeMappingComposite( - OrmXmlUiFactory factory, - PropertyValueModel<OrmIdMapping> subjectHolder, - Composite parent, - WidgetFactory widgetFactory) { - - return factory.createOrmIdMappingComposite(subjectHolder, parent, widgetFactory); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmInheritanceComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmInheritanceComposite.java deleted file mode 100644 index cbeadd2cd5..0000000000 --- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmInheritanceComposite.java +++ /dev/null @@ -1,44 +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.ui.internal.details.orm; - -import org.eclipse.jpt.common.ui.internal.widgets.Pane; -import org.eclipse.jpt.jpa.core.context.orm.OrmEntity; -import org.eclipse.jpt.jpa.ui.internal.details.AbstractInheritanceComposite; -import org.eclipse.swt.widgets.Composite; - -/** - * The pane used for java inheritance. - * - * @see OrmEntity - * @see OrmPrimaryKeyJoinColumnsComposite - * - * @version 2.0 - * @since 1.0 - */ -public class OrmInheritanceComposite extends AbstractInheritanceComposite<OrmEntity> { - - /** - * Creates a new <code>OrmInheritanceComposite</code>. - * - * @param parentPane The parent container of this one - * @param parent The parent container - */ - public OrmInheritanceComposite(Pane<? extends OrmEntity> parentPane, - Composite parent) { - - super(parentPane, parent); - } - - @Override - protected void addPrimaryKeyJoinColumnsComposite(Composite container) { - new OrmPrimaryKeyJoinColumnsComposite(this, container); - } -}
\ No newline at end of file diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmJavaClassChooser.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmJavaClassChooser.java deleted file mode 100644 index eaadc6576c..0000000000 --- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmJavaClassChooser.java +++ /dev/null @@ -1,112 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 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.ui.internal.details.orm; - -import org.eclipse.jdt.core.IJavaProject; -import org.eclipse.jpt.common.ui.internal.widgets.ClassChooserPane; -import org.eclipse.jpt.common.ui.internal.widgets.Pane; -import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter; -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.orm.OrmTypeMapping; -import org.eclipse.swt.widgets.Composite; - -/** - * Here the layout of this pane: - * <pre> - * ----------------------------------------------------------------------------- - * | | - * | ClassChooserPane | - * | | - * -----------------------------------------------------------------------------</pre> - * - * TODO possibly help the user and if they have chosen a package at the - * entity-mappings level only insert the class name in the xml file if they - * choose a class from the package. - * Not sure if this should be driven by the UI or by ui api in the model - * - * @see OrmTypeMapping - * @see OrmPersistentTypeDetailsPage - The parent container - * @see ClassChooserPane - * - * @version 2.0 - * @since 1.0 - */ -public class OrmJavaClassChooser extends Pane<OrmTypeMapping> { - - /** - * Creates a new <code>XmlJavaClassChooser</code>. - * - * @param parentPane The parent controller of this one - * @param subjectHolder The holder of this pane's subject - * @param parent The parent container - */ - public OrmJavaClassChooser(Pane<?> parentPane, - PropertyValueModel<? extends OrmTypeMapping> subjectHolder, - Composite parent) { - - super(parentPane, subjectHolder, parent); - } - - public OrmJavaClassChooser(Pane<?> parentPane, - PropertyValueModel<? extends OrmTypeMapping> subjectHolder, - Composite parent, - boolean automaticallyAlignWidgets) { - - super(parentPane, subjectHolder, parent, automaticallyAlignWidgets); - } - - - private ClassChooserPane<OrmTypeMapping> addClassChooser(Composite container) { - - return new ClassChooserPane<OrmTypeMapping>(this, container) { - - @Override - protected WritablePropertyValueModel<String> buildTextHolder() { - return new PropertyAspectAdapter<OrmTypeMapping, String>(getSubjectHolder(), OrmTypeMapping.CLASS_PROPERTY) { - @Override - protected String buildValue_() { - return this.subject.getClass_(); - } - - @Override - protected void setValue_(String value) { - this.subject.setClass(value); - } - }; - } - - @Override - protected String getClassName() { - return getSubject().getClass_(); - } - - @Override - protected String getLabelText() { - return JptUiDetailsOrmMessages.OrmJavaClassChooser_javaClass; - } - - @Override - protected IJavaProject getJavaProject() { - return getSubject().getJpaProject().getJavaProject(); - } - - @Override - protected void setClassName(String className) { - getSubject().setClass(className); - } - }; - } - - @Override - protected void initializeLayout(Composite container) { - addClassChooser(container); - } -}
\ No newline at end of file diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmManyToManyMappingComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmManyToManyMappingComposite.java deleted file mode 100644 index 21a0743a69..0000000000 --- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmManyToManyMappingComposite.java +++ /dev/null @@ -1,90 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 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.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.ManyToManyRelationship; -import org.eclipse.jpt.jpa.ui.internal.details.AbstractManyToManyMappingComposite; -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.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 1.0 - */ -public class OrmManyToManyMappingComposite - extends AbstractManyToManyMappingComposite<ManyToManyMapping, ManyToManyRelationship> -{ - /** - * 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 OrmManyToManyMappingComposite(PropertyValueModel<? extends ManyToManyMapping> 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 CascadeComposite(this, buildCascadeHolder(), addSubPane(container, 5)); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmManyToManyMappingUiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmManyToManyMappingUiDefinition.java deleted file mode 100644 index ee2e44615a..0000000000 --- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmManyToManyMappingUiDefinition.java +++ /dev/null @@ -1,56 +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.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.core.context.orm.OrmManyToManyMapping; -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.jpt.jpa.ui.internal.details.AbstractManyToManyMappingUiDefinition; -import org.eclipse.swt.widgets.Composite; - -public class OrmManyToManyMappingUiDefinition - extends AbstractManyToManyMappingUiDefinition<ReadOnlyPersistentAttribute, OrmManyToManyMapping> - implements OrmAttributeMappingUiDefinition<OrmManyToManyMapping> -{ - // singleton - private static final OrmManyToManyMappingUiDefinition INSTANCE = - new OrmManyToManyMappingUiDefinition(); - - - /** - * Return the singleton. - */ - public static OrmAttributeMappingUiDefinition<OrmManyToManyMapping> instance() { - return INSTANCE; - } - - - /** - * Ensure single instance. - */ - private OrmManyToManyMappingUiDefinition() { - super(); - } - - - public JpaComposite buildAttributeMappingComposite( - OrmXmlUiFactory factory, - PropertyValueModel<OrmManyToManyMapping> subjectHolder, - Composite parent, - WidgetFactory widgetFactory) { - - return factory.createOrmManyToManyMappingComposite(subjectHolder, parent, widgetFactory); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmManyToOneMappingComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmManyToOneMappingComposite.java deleted file mode 100644 index 8cb0a652c8..0000000000 --- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmManyToOneMappingComposite.java +++ /dev/null @@ -1,92 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 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.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.ManyToOneMapping; -import org.eclipse.jpt.jpa.core.context.orm.OrmManyToOneMapping; -import org.eclipse.jpt.jpa.core.context.orm.OrmManyToOneRelationship; -import org.eclipse.jpt.jpa.ui.internal.details.AbstractManyToOneMappingComposite; -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.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 1.0 - */ -public class OrmManyToOneMappingComposite - extends AbstractManyToOneMappingComposite<OrmManyToOneMapping, OrmManyToOneRelationship> -{ - /** - * Creates a new <code>ManyToOneMappingComposite</code>. - * - * @param subjectHolder The holder of the subject <code>IManyToOneMapping</code> - * @param parent The parent container - * @param widgetFactory The factory used to create various common widgets - */ - public OrmManyToOneMappingComposite(PropertyValueModel<? extends OrmManyToOneMapping> 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 OptionalComposite(this, container); - new CascadeComposite(this, buildCascadeHolder(), addSubPane(container, 5)); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmManyToOneMappingUiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmManyToOneMappingUiDefinition.java deleted file mode 100644 index 2738762508..0000000000 --- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmManyToOneMappingUiDefinition.java +++ /dev/null @@ -1,56 +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.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.core.context.orm.OrmManyToOneMapping; -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.jpt.jpa.ui.internal.details.AbstractManyToOneMappingUiDefinition; -import org.eclipse.swt.widgets.Composite; - -public class OrmManyToOneMappingUiDefinition - extends AbstractManyToOneMappingUiDefinition<ReadOnlyPersistentAttribute, OrmManyToOneMapping> - implements OrmAttributeMappingUiDefinition<OrmManyToOneMapping> -{ - // singleton - private static final OrmManyToOneMappingUiDefinition INSTANCE = - new OrmManyToOneMappingUiDefinition(); - - - /** - * Return the singleton. - */ - public static OrmAttributeMappingUiDefinition<OrmManyToOneMapping> instance() { - return INSTANCE; - } - - - /** - * Ensure single instance. - */ - private OrmManyToOneMappingUiDefinition() { - super(); - } - - - public JpaComposite buildAttributeMappingComposite( - OrmXmlUiFactory factory, - PropertyValueModel<OrmManyToOneMapping> subjectHolder, - Composite parent, - WidgetFactory widgetFactory) { - - return factory.createOrmManyToOneMappingComposite(subjectHolder, parent, widgetFactory); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmMappedSuperclassComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmMappedSuperclassComposite.java deleted file mode 100644 index b26ea5dd75..0000000000 --- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmMappedSuperclassComposite.java +++ /dev/null @@ -1,51 +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.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.orm.OrmMappedSuperclass; -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.swt.widgets.Composite; - -public class OrmMappedSuperclassComposite - extends AbstractMappedSuperclassComposite<OrmMappedSuperclass> - implements JpaComposite -{ - public OrmMappedSuperclassComposite( - PropertyValueModel<? extends OrmMappedSuperclass> subjectHolder, - Composite parent, - WidgetFactory widgetFactory) { - - super(subjectHolder, parent, widgetFactory); - } - - @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 PropertyValueModel<AccessHolder> buildAccessHolder() { - return new PropertyAspectAdapter<OrmMappedSuperclass, AccessHolder>(getSubjectHolder()) { - @Override - protected AccessHolder buildValue_() { - return this.subject.getPersistentType(); - } - }; - } -} diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmMappedSuperclassUiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmMappedSuperclassUiDefinition.java deleted file mode 100644 index 3b919460e1..0000000000 --- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmMappedSuperclassUiDefinition.java +++ /dev/null @@ -1,55 +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.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.PersistentType; -import org.eclipse.jpt.jpa.core.context.orm.OrmMappedSuperclass; -import org.eclipse.jpt.jpa.ui.details.JpaComposite; -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.AbstractMappedSuperclassUiDefinition; -import org.eclipse.swt.widgets.Composite; - -public class OrmMappedSuperclassUiDefinition - extends AbstractMappedSuperclassUiDefinition<PersistentType, OrmMappedSuperclass> - implements OrmTypeMappingUiDefinition<OrmMappedSuperclass> -{ - // singleton - private static final OrmMappedSuperclassUiDefinition INSTANCE = - new OrmMappedSuperclassUiDefinition(); - - - /** - * Return the singleton. - */ - public static OrmTypeMappingUiDefinition<OrmMappedSuperclass> instance() { - return INSTANCE; - } - - - /** - * Ensure single instance. - */ - private OrmMappedSuperclassUiDefinition() { - super(); - } - - - public JpaComposite buildTypeMappingComposite( - OrmXmlUiFactory factory, - PropertyValueModel<OrmMappedSuperclass> subjectHolder, - Composite parent, - WidgetFactory widgetFactory) { - - return factory.createOrmMappedSuperclassComposite(subjectHolder, parent, widgetFactory); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmMappingNameChooser.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmMappingNameChooser.java deleted file mode 100644 index 1dc11a6f49..0000000000 --- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmMappingNameChooser.java +++ /dev/null @@ -1,71 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 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.ui.internal.details.orm; - -import org.eclipse.jpt.common.ui.internal.widgets.Pane; -import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter; -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.AttributeMapping; -import org.eclipse.jpt.jpa.core.context.orm.OrmAttributeMapping; -import org.eclipse.swt.widgets.Composite; - -/** - * @see OrmPersistentAttributeDetailsPage - The parent container - * - * @version 2.3 - * @since 1.0 - */ -public class OrmMappingNameChooser - extends Pane<AttributeMapping> -{ - /** - * Creates a new <code>XmlJavaAttributeChooser</code>. - * - * @param parentPane The parent container of this one - * @param subjectHolder The holder of this pane's subject - * @param parent The parent container - */ - public OrmMappingNameChooser(Pane<?> parentPane, - PropertyValueModel<? extends AttributeMapping> subjectHolder, - Composite parent) { - - super(parentPane, subjectHolder, parent); - } - - @Override - protected void initializeLayout(Composite container) { - this.addLabeledText( - container, - JptUiDetailsOrmMessages.OrmMappingNameChooser_name, - buildNameHolder() - ); - } - private WritablePropertyValueModel<String> buildNameHolder() { - return new PropertyAspectAdapter<AttributeMapping, String>(getSubjectHolder(), OrmAttributeMapping.NAME_PROPERTY) { - @Override - protected String buildValue_() { - return this.subject.getName(); - } - - @Override - protected void setValue_(String value) { - if (this.subject.getPersistentAttribute().isVirtual()) { - return; - } - if (value.length() == 0) { - value = null; - } - // we can safely cast to an orm.xml mapping since it is not virtual - ((OrmAttributeMapping) this.subject).setName(value); - } - }; - } -}
\ No newline at end of file diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmOneToManyMappingComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmOneToManyMappingComposite.java deleted file mode 100644 index da0df67b48..0000000000 --- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmOneToManyMappingComposite.java +++ /dev/null @@ -1,89 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 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.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.OneToManyMapping; -import org.eclipse.jpt.jpa.core.context.OneToManyRelationship; -import org.eclipse.jpt.jpa.ui.internal.details.AbstractOneToManyMappingComposite; -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.JoinTableComposite; -import org.eclipse.jpt.jpa.ui.internal.details.OrderingComposite; -import org.eclipse.jpt.jpa.ui.internal.details.TargetEntityComposite; -import org.eclipse.swt.widgets.Composite; - -/** - * Here the layout of this pane: - * <pre> - * ----------------------------------------------------------------------------- - * | ------------------------------------------------------------------------- | - * | | | | - * | | TargetEntityComposite | | - * | | | | - * | ------------------------------------------------------------------------- | - * | ------------------------------------------------------------------------- | - * | | | | - * | | JoiningStrategyComposite | | - * | | | | - * | ------------------------------------------------------------------------- | - * | ------------------------------------------------------------------------- | - * | | | | - * | | FetchTypeComposite | | - * | | | | - * | ------------------------------------------------------------------------- | - * | ------------------------------------------------------------------------- | - * | | | | - * | | CascadeComposite | | - * | | | | - * | ------------------------------------------------------------------------- | - * | ------------------------------------------------------------------------- | - * | | | | - * | | OrderingComposite | | - * | | | | - * | ------------------------------------------------------------------------- | - * -----------------------------------------------------------------------------</pre> - * - * @see OneToManyMapping - * @see CascadeComposite - * @see FetchTypeComposite - * @see JoinTableComposite - * @see OrderingComposite - * @see TargetEntityComposite - * - * @version 2.3 - * @since 1.0 - */ -public class OrmOneToManyMappingComposite - extends AbstractOneToManyMappingComposite<OneToManyMapping, OneToManyRelationship> -{ - /** - * Creates a new <code>OneToManyMappingComposite</code>. - * - * @param subjectHolder The holder of the subject <code>IOneToManyMapping</code> - * @param parent The parent container - * @param widgetFactory The factory used to create various common widgets - */ - public OrmOneToManyMappingComposite(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 CascadeComposite(this, buildCascadeHolder(), addSubPane(container, 5)); - } -}
\ No newline at end of file diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmOneToManyMappingUiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmOneToManyMappingUiDefinition.java deleted file mode 100644 index f899ac6b7c..0000000000 --- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmOneToManyMappingUiDefinition.java +++ /dev/null @@ -1,56 +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.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.core.context.orm.OrmOneToManyMapping; -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.jpt.jpa.ui.internal.details.AbstractOneToManyMappingUiDefinition; -import org.eclipse.swt.widgets.Composite; - -public class OrmOneToManyMappingUiDefinition - extends AbstractOneToManyMappingUiDefinition<ReadOnlyPersistentAttribute, OrmOneToManyMapping> - implements OrmAttributeMappingUiDefinition<OrmOneToManyMapping> -{ - // singleton - private static final OrmOneToManyMappingUiDefinition INSTANCE = - new OrmOneToManyMappingUiDefinition(); - - - /** - * Return the singleton. - */ - public static OrmAttributeMappingUiDefinition<OrmOneToManyMapping> instance() { - return INSTANCE; - } - - - /** - * Ensure single instance. - */ - private OrmOneToManyMappingUiDefinition() { - super(); - } - - - public JpaComposite buildAttributeMappingComposite( - OrmXmlUiFactory factory, - PropertyValueModel<OrmOneToManyMapping> subjectHolder, - Composite parent, - WidgetFactory widgetFactory) { - - return factory.createOrmOneToManyMappingComposite(subjectHolder, parent, widgetFactory); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmOneToOneMappingComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmOneToOneMappingComposite.java deleted file mode 100644 index e072ae3c81..0000000000 --- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmOneToOneMappingComposite.java +++ /dev/null @@ -1,91 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 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.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.OneToOneMapping; -import org.eclipse.jpt.jpa.core.context.OneToOneRelationship; -import org.eclipse.jpt.jpa.ui.internal.details.AbstractOneToOneMappingComposite; -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.OptionalComposite; -import org.eclipse.jpt.jpa.ui.internal.details.TargetEntityComposite; -import org.eclipse.swt.widgets.Composite; - -/** - * Here the layout of this pane: - * <pre> - * ----------------------------------------------------------------------------- - * | ------------------------------------------------------------------------- | - * | | | | - * | | TargetEntityComposite | | - * | | | | - * | ------------------------------------------------------------------------- | - * | ------------------------------------------------------------------------- | - * | | | | - * | | JoiningStrategyComposite | | - * | | | | - * | ------------------------------------------------------------------------- | - * | ------------------------------------------------------------------------- | - * | | | | - * | | FetchTypeComposite | | - * | | | | - * | ------------------------------------------------------------------------- | - * | ------------------------------------------------------------------------- | - * | | | | - * | | OptionalComposite | | - * | | | | - * | ------------------------------------------------------------------------- | - * | ------------------------------------------------------------------------- | - * | | | | - * | | CascadeComposite | | - * | | | | - * | ------------------------------------------------------------------------- | - * -----------------------------------------------------------------------------</pre> - * - * @see OneToOneMapping - * @see TargetEntityComposite - * @see JoiningStrategyComposite - * @see FetchTypeComposite - * @see OptionalComposite - * @see CascadeComposite - * - * @version 2.3 - * @since 1.0 - */ -public class OrmOneToOneMappingComposite - extends AbstractOneToOneMappingComposite<OneToOneMapping, OneToOneRelationship> -{ - /** - * Creates a new <code>OneToOneMappingComposite</code>. - * - * @param subjectHolder The holder of the subject <code>IOneToOneMapping</code> - * @param parent The parent container - * @param widgetFactory The factory used to create various common widgets - */ - public OrmOneToOneMappingComposite(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 OptionalComposite(this, container); - new CascadeComposite(this, buildCascadeHolder(), addSubPane(container, 5)); - } - - -}
\ No newline at end of file diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmOneToOneMappingUiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmOneToOneMappingUiDefinition.java deleted file mode 100644 index c37fa42c50..0000000000 --- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmOneToOneMappingUiDefinition.java +++ /dev/null @@ -1,56 +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.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.core.context.orm.OrmOneToOneMapping; -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.jpt.jpa.ui.internal.details.AbstractOneToOneMappingUiDefinition; -import org.eclipse.swt.widgets.Composite; - -public class OrmOneToOneMappingUiDefinition - extends AbstractOneToOneMappingUiDefinition<ReadOnlyPersistentAttribute, OrmOneToOneMapping> - implements OrmAttributeMappingUiDefinition<OrmOneToOneMapping> -{ - // singleton - private static final OrmOneToOneMappingUiDefinition INSTANCE = - new OrmOneToOneMappingUiDefinition(); - - - /** - * Return the singleton. - */ - public static OrmAttributeMappingUiDefinition<OrmOneToOneMapping> instance() { - return INSTANCE; - } - - - /** - * Ensure single instance. - */ - private OrmOneToOneMappingUiDefinition() { - super(); - } - - - public JpaComposite buildAttributeMappingComposite( - OrmXmlUiFactory factory, - PropertyValueModel<OrmOneToOneMapping> subjectHolder, - Composite parent, - WidgetFactory widgetFactory) { - - return factory.createOrmOneToOneMappingComposite(subjectHolder, parent, widgetFactory); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmPackageChooser.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmPackageChooser.java deleted file mode 100644 index 06a93c3aae..0000000000 --- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmPackageChooser.java +++ /dev/null @@ -1,98 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 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.ui.internal.details.orm; - -import org.eclipse.jdt.core.IJavaProject; -import org.eclipse.jpt.common.ui.internal.widgets.PackageChooserPane; -import org.eclipse.jpt.common.ui.internal.widgets.Pane; -import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter; -import org.eclipse.jpt.common.utility.model.value.WritablePropertyValueModel; -import org.eclipse.jpt.jpa.core.context.orm.EntityMappings; -import org.eclipse.swt.widgets.Composite; - -/** - * Here the layout of this pane: - * <pre> - * ----------------------------------------------------------------------------- - * | | - * | PackageChooserPane | - * | | - * -----------------------------------------------------------------------------</pre> - * - * @see EntityMappings - * @see EntityMappingsDetailsPage - The parent container - * @see PackageChooserPane - * - * @version 2.0 - * @since 2.0 - */ -public class OrmPackageChooser extends Pane<EntityMappings> -{ - /** - * Creates a new <code>XmlPackageChooser</code>. - * - * @param parentPane The parent controller of this one - * @param parent The parent container - */ - public OrmPackageChooser(Pane<? extends EntityMappings> parentPane, - Composite parent) { - - super(parentPane, parent); - } - - /* - * (non-Javadoc) - */ - @Override - protected void initializeLayout(Composite container) { - - addPackageChooserPane(container); - } - - private void addPackageChooserPane(Composite container) { - - new PackageChooserPane<EntityMappings>(this, container) { - @Override - protected WritablePropertyValueModel<String> buildTextHolder() { - return new PropertyAspectAdapter<EntityMappings, String>(getSubjectHolder(), EntityMappings.PACKAGE_PROPERTY) { - @Override - protected String buildValue_() { - return subject.getPackage(); - } - - @Override - protected void setValue_(String value) { - subject.setPackage(value == "" ? null : value); //$NON-NLS-1$ - } - }; - } - - @Override - protected String getLabelText() { - return JptUiDetailsOrmMessages.EntityMappingsDetailsPage_package; - } - - @Override - protected IJavaProject getJavaProject() { - return getSubject().getJpaProject().getJavaProject(); - } - - @Override - protected String getPackageName() { - return getSubject().getPackage(); - } - - @Override - protected void setPackageName(String packageName) { - getSubject().setPackage(packageName); - } - }; - } -}
\ No newline at end of file diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmPersistentAttributeDetailsPage.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmPersistentAttributeDetailsPage.java deleted file mode 100644 index 144e10cde1..0000000000 --- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmPersistentAttributeDetailsPage.java +++ /dev/null @@ -1,114 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2010 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.jpa.ui.internal.details.orm; - -import java.util.ArrayList; -import org.eclipse.jpt.common.ui.WidgetFactory; -import org.eclipse.jpt.common.ui.internal.util.PaneEnabler; -import org.eclipse.jpt.common.ui.internal.widgets.Pane; -import org.eclipse.jpt.common.utility.internal.model.value.TransformationPropertyValueModel; -import org.eclipse.jpt.common.utility.model.value.PropertyValueModel; -import org.eclipse.jpt.jpa.core.context.ReadOnlyPersistentAttribute; -import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute; -import org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyPersistentAttribute; -import org.eclipse.jpt.jpa.ui.details.JpaComposite; -import org.eclipse.jpt.jpa.ui.internal.details.PersistentAttributeDetailsPage; -import org.eclipse.jpt.jpa.ui.internal.details.PersistentAttributeMapAsComposite; -import org.eclipse.swt.widgets.Composite; - -/** - * The default implementation of the details page used for the XML persistent - * attribute. - * <p> - * Here the layout of this pane: - * <pre> - * ----------------------------------------------------------------------------- - * | ------------------------------------------------------------------------- | - * | | | | - * | | OrmPersistentAttributeMapAsComposite | | - * | | | | - * | ------------------------------------------------------------------------- | - * | ------------------------------------------------------------------------- | - * | | | | - * | | Attribute mapping pane | | - * | | | | - * | ------------------------------------------------------------------------- | - * -----------------------------------------------------------------------------</pre> - * - * @see OrmPersistentAttribute - * @see OrmPersistentAttributeMapAsComposite - * - * @version 2.3 - * @since 2.0 - */ -public class OrmPersistentAttributeDetailsPage - extends PersistentAttributeDetailsPage<OrmReadOnlyPersistentAttribute> -{ - /** - * Creates a new <code>OrmPersistentAttributeDetailsPage</code>. - * - * @param parent The parent container - * @param widgetFactory The factory used to create various common widgets - */ - public OrmPersistentAttributeDetailsPage(Composite parent, - WidgetFactory widgetFactory) { - - super(parent, widgetFactory); - } - - @Override - protected void initializeLayout(Composite container) { - - ArrayList<Pane<?>> panes = new ArrayList<Pane<?>>(2); - - // Map As composite - Pane<?> mapAsPane = buildMapAsPane(addSubPane(container, 0, 0, 5, 0)); - panes.add(mapAsPane); - - buildMappingPageBook(container); - - installPaneEnabler(panes); - } - - protected Pane<ReadOnlyPersistentAttribute> buildMapAsPane(Composite parent) { - return new PersistentAttributeMapAsComposite(this, parent); - } - - private void installPaneEnabler(ArrayList<Pane<?>> panes) { - new PaneEnabler(buildPaneEnablerHolder(), panes); - } - - private PropertyValueModel<Boolean> buildPaneEnablerHolder() { - return new TransformationPropertyValueModel<OrmReadOnlyPersistentAttribute, Boolean>(getSubjectHolder()) { - @Override - protected Boolean transform_(OrmReadOnlyPersistentAttribute value) { - return Boolean.valueOf(!value.isVirtual()); - } - }; - } - - - //TODO this probably needs to change and use a PaneEnabler instead. - @Override - protected JpaComposite getMappingComposite(String key) { - JpaComposite mappingComposite = super.getMappingComposite(key); - if (mappingComposite == null) { - return null; - } - boolean enabled = false; - - if (getSubject() != null && getSubject().getParent() != null) { - enabled = !getSubject().isVirtual(); - } - - mappingComposite.enableWidgets(enabled); - return mappingComposite; - } -}
\ No newline at end of file diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmPersistentAttributeDetailsProvider.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmPersistentAttributeDetailsProvider.java deleted file mode 100644 index 9527d29496..0000000000 --- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmPersistentAttributeDetailsProvider.java +++ /dev/null @@ -1,61 +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.ui.internal.details.orm; - -import org.eclipse.jpt.common.ui.WidgetFactory; -import org.eclipse.jpt.common.utility.internal.Tools; -import org.eclipse.jpt.jpa.core.JpaStructureNode; -import org.eclipse.jpt.jpa.core.JptJpaCorePlugin; -import org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyPersistentAttribute; -import org.eclipse.jpt.jpa.core.context.orm.OrmStructureNodes; -import org.eclipse.jpt.jpa.ui.details.JpaDetailsPage; -import org.eclipse.jpt.jpa.ui.details.JpaDetailsProvider; -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). - */ -public class OrmPersistentAttributeDetailsProvider - implements JpaDetailsProvider -{ - // singleton - private static final JpaDetailsProvider INSTANCE = new OrmPersistentAttributeDetailsProvider(); - - - /** - * Return the singleton - */ - public static JpaDetailsProvider instance() { - return INSTANCE; - } - - - /** - * Enforce singleton usage - */ - private OrmPersistentAttributeDetailsProvider() { - super(); - } - - - public boolean providesDetails(JpaStructureNode structureNode) { - return Tools.valuesAreEqual(structureNode.getId(), OrmStructureNodes.PERSISTENT_ATTRIBUTE_ID) - && structureNode.getResourceType().getContentType().isKindOf(JptJpaCorePlugin.MAPPING_FILE_CONTENT_TYPE); - } - - public JpaDetailsPage<OrmReadOnlyPersistentAttribute> buildDetailsPage( - Composite parent, - WidgetFactory widgetFactory) { - - return new OrmPersistentAttributeDetailsPage(parent, widgetFactory); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmPersistentTypeDetailsProvider.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmPersistentTypeDetailsProvider.java deleted file mode 100644 index 4dd48709d9..0000000000 --- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmPersistentTypeDetailsProvider.java +++ /dev/null @@ -1,62 +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.ui.internal.details.orm; - -import org.eclipse.jpt.common.ui.WidgetFactory; -import org.eclipse.jpt.common.utility.internal.Tools; -import org.eclipse.jpt.jpa.core.JpaStructureNode; -import org.eclipse.jpt.jpa.core.JptJpaCorePlugin; -import org.eclipse.jpt.jpa.core.context.PersistentType; -import org.eclipse.jpt.jpa.core.context.orm.OrmStructureNodes; -import org.eclipse.jpt.jpa.ui.details.JpaDetailsPage; -import org.eclipse.jpt.jpa.ui.details.JpaDetailsProvider; -import org.eclipse.jpt.jpa.ui.internal.details.PersistentTypeDetailsPage; -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). - */ -public class OrmPersistentTypeDetailsProvider - implements JpaDetailsProvider -{ - // singleton - private static final JpaDetailsProvider INSTANCE = new OrmPersistentTypeDetailsProvider(); - - - /** - * Return the singleton - */ - public static JpaDetailsProvider instance() { - return INSTANCE; - } - - - /** - * Enforce singleton usage - */ - private OrmPersistentTypeDetailsProvider() { - super(); - } - - - public boolean providesDetails(JpaStructureNode structureNode) { - return Tools.valuesAreEqual(structureNode.getId(), OrmStructureNodes.PERSISTENT_TYPE_ID) - && structureNode.getResourceType().getContentType().isKindOf(JptJpaCorePlugin.MAPPING_FILE_CONTENT_TYPE); - } - - public JpaDetailsPage<PersistentType> buildDetailsPage( - Composite parent, - WidgetFactory widgetFactory) { - - return new PersistentTypeDetailsPage(parent, widgetFactory); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmPrimaryKeyJoinColumnsComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmPrimaryKeyJoinColumnsComposite.java deleted file mode 100644 index 2769853208..0000000000 --- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmPrimaryKeyJoinColumnsComposite.java +++ /dev/null @@ -1,70 +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.ui.internal.details.orm; - -import java.util.ListIterator; -import org.eclipse.jpt.common.ui.internal.widgets.Pane; -import org.eclipse.jpt.common.utility.internal.model.value.ListAspectAdapter; -import org.eclipse.jpt.common.utility.model.value.ListValueModel; -import org.eclipse.jpt.jpa.core.context.PrimaryKeyJoinColumn; -import org.eclipse.jpt.jpa.core.context.ReadOnlyPrimaryKeyJoinColumn; -import org.eclipse.jpt.jpa.core.context.orm.OrmEntity; -import org.eclipse.jpt.jpa.ui.internal.details.AbstractPrimaryKeyJoinColumnsComposite; -import org.eclipse.swt.widgets.Composite; - -/** - * @see OrmEntity - * @see OrmInheritanceComposite - The container of this pane - * - * @version 2.0 - * @since 2.0 - */ -public class OrmPrimaryKeyJoinColumnsComposite extends AbstractPrimaryKeyJoinColumnsComposite<OrmEntity> -{ - public OrmPrimaryKeyJoinColumnsComposite(Pane<? extends OrmEntity> subjectHolder, - Composite parent) { - - super(subjectHolder, parent); - } - - @Override - protected ListValueModel<ReadOnlyPrimaryKeyJoinColumn> buildDefaultJoinColumnsListHolder() { - return new ListAspectAdapter<OrmEntity, ReadOnlyPrimaryKeyJoinColumn>( - getSubjectHolder(), - OrmEntity.DEFAULT_PRIMARY_KEY_JOIN_COLUMNS_LIST) - { - @Override - protected ListIterator<ReadOnlyPrimaryKeyJoinColumn> listIterator_() { - return subject.defaultPrimaryKeyJoinColumns(); - } -//TODO defaultPrimaryKeyJoinColumnsSize when I can change the API -// @Override -// protected int size_() { -// return subject.defaultPrimaryKeyJoinColumnsSize(); -// } - }; - } - - @Override - protected void switchDefaultToSpecified() { - ListIterator<ReadOnlyPrimaryKeyJoinColumn> defaultJoinColumns = getSubject().defaultPrimaryKeyJoinColumns(); - - while (defaultJoinColumns.hasNext()) { - ReadOnlyPrimaryKeyJoinColumn defaultJoinColumn = defaultJoinColumns.next(); - String columnName = defaultJoinColumn.getName(); - String referencedColumnName = defaultJoinColumn.getReferencedColumnName(); - - PrimaryKeyJoinColumn pkJoinColumn = getSubject().addSpecifiedPrimaryKeyJoinColumn(); - pkJoinColumn.setSpecifiedName(columnName); - pkJoinColumn.setSpecifiedReferencedColumnName(referencedColumnName); - } - } - -}
\ No newline at end of file diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmQueriesComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmQueriesComposite.java deleted file mode 100644 index 98d6dbb72a..0000000000 --- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmQueriesComposite.java +++ /dev/null @@ -1,94 +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.ui.internal.details.orm; - -import org.eclipse.jpt.common.ui.internal.util.PaneEnabler; -import org.eclipse.jpt.common.ui.internal.widgets.Pane; -import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter; -import org.eclipse.jpt.common.utility.internal.model.value.TransformationPropertyValueModel; -import org.eclipse.jpt.common.utility.model.value.PropertyValueModel; -import org.eclipse.jpt.jpa.core.context.QueryContainer; -import org.eclipse.jpt.jpa.core.context.orm.EntityMappings; -import org.eclipse.jpt.jpa.ui.internal.details.QueriesComposite; -import org.eclipse.swt.widgets.Composite; - -/** - * Here the layout of this pane: - * <pre> - * ----------------------------------------------------------------------------- - * | ------------------------------------------------------------------------- | - * | | | | - * | | QueriesComposite | | - * | | | | - * | ------------------------------------------------------------------------- | - * -----------------------------------------------------------------------------</pre> - * - * @see EntityMappings - * @see EntityMappingsDetailsPage - The parent container - * @see QueriesComposite - * - * @version 2.0 - * @since 2.0 - */ -public class OrmQueriesComposite extends Pane<EntityMappings> { - - /** - * Creates a new <code>OrmQueriesComposite</code>. - * - * @param parentPane The parent container of this one - * @param parent The parent container - */ - public OrmQueriesComposite(Pane<? extends EntityMappings> parentPane, - Composite parent) { - - super(parentPane, parent, false); - } - - private PropertyValueModel<Boolean> buildPaneEnablerHolder() { - return new TransformationPropertyValueModel<EntityMappings, Boolean>(getSubjectHolder()) { - @Override - protected Boolean transform(EntityMappings value) { - return (value != null); - } - }; - } - - @Override - protected void initializeLayout(Composite container) { - - container = this.addCollapsibleSection( - container, - JptUiDetailsOrmMessages.OrmQueriesComposite_groupBox - ); - - QueriesComposite queriesComposite = this.buildQueriesComposite(container, this.buildQueryContainerHolder()); - - this.installPaneEnabler(queriesComposite); - } - - protected QueriesComposite buildQueriesComposite(Composite container, PropertyValueModel<QueryContainer> queryContainerHolder) { - return new QueriesComposite(this, queryContainerHolder, container); - } - - private PropertyValueModel<QueryContainer> buildQueryContainerHolder() { - return new PropertyAspectAdapter<EntityMappings, QueryContainer>(getSubjectHolder()) { - @Override - protected QueryContainer buildValue_() { - return this.subject.getQueryContainer(); - } - }; - } - private void installPaneEnabler(QueriesComposite queriesComposite) { - new PaneEnabler( - buildPaneEnablerHolder(), - queriesComposite - ); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmSecondaryTablesComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmSecondaryTablesComposite.java deleted file mode 100644 index 397ab90092..0000000000 --- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmSecondaryTablesComposite.java +++ /dev/null @@ -1,211 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2010 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.jpa.ui.internal.details.orm; - -import java.util.ArrayList; -import java.util.List; -import java.util.ListIterator; -import org.eclipse.jpt.common.ui.WidgetFactory; -import org.eclipse.jpt.common.ui.internal.util.PaneEnabler; -import org.eclipse.jpt.common.ui.internal.widgets.AddRemoveListPane; -import org.eclipse.jpt.common.ui.internal.widgets.Pane; -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.ListPropertyValueModelAdapter; -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.Entity; -import org.eclipse.jpt.jpa.core.context.ReadOnlySecondaryTable; -import org.eclipse.jpt.jpa.core.context.ReadOnlyTable; -import org.eclipse.jpt.jpa.core.context.SecondaryTable; -import org.eclipse.jpt.jpa.core.context.orm.OrmEntity; -import org.eclipse.jpt.jpa.core.context.orm.OrmSecondaryTable; -import org.eclipse.jpt.jpa.core.context.orm.OrmVirtualSecondaryTable; -import org.eclipse.jpt.jpa.ui.internal.JpaHelpContextIds; -import org.eclipse.jpt.jpa.ui.internal.details.AbstractSecondaryTablesComposite; -import org.eclipse.jpt.jpa.ui.internal.details.JptUiDetailsMessages; -import org.eclipse.jpt.jpa.ui.internal.details.PrimaryKeyJoinColumnsInSecondaryTableComposite; -import org.eclipse.jpt.jpa.ui.internal.details.SecondaryTableDialog; -import org.eclipse.swt.widgets.Composite; - -/** - * Here the layout of this pane: - * <pre> - * ----------------------------------------------------------------------------- - * | ------------------------------------------------------------------------- | - * | | | | - * | | AddRemoveListPane | | - * | | | | - * | ------------------------------------------------------------------------- | - * | ------------------------------------------------------------------------- | - * | | | | - * | | PrimaryKeyJoinColumnsInSecondaryTableComposite | | - * | | | | - * | ------------------------------------------------------------------------- | - * -----------------------------------------------------------------------------</pre> - * - * @see OrmEntity - * @see OrmEntityComposite - The container of this pane - * @see AddRemoveListPane - * @see PrimaryKeyJoinColumnsInSecondaryTableComposite - * - * @version 2.0 - * @since 1.0 - */ -public class OrmSecondaryTablesComposite extends AbstractSecondaryTablesComposite<OrmEntity> -{ - /** - * Creates a new <code>OrmSecondaryTablesComposite</code>. - * - * @param parentPane The parent container of this one - * @param parent The parent container - */ - public OrmSecondaryTablesComposite(Pane<? extends OrmEntity> parentPane, - Composite parent) { - - super(parentPane, parent); - } - - /** - * Creates a new <code>SecondaryTablesComposite</code>. - * - * @param subjectHolder The holder of the subject <code>IEntity</code> - * @param parent The parent container - * @param widgetFactory The factory used to create various common widgets - */ - public OrmSecondaryTablesComposite(PropertyValueModel<? extends OrmEntity> subjectHolder, - Composite parent, - WidgetFactory widgetFactory) { - - super(subjectHolder, parent, widgetFactory); - } - - private WritablePropertyValueModel<Boolean> buildDefineInXmlHolder() { - return new DefineInXmlHolder(); - } - - private ListValueModel<ReadOnlySecondaryTable> buildSecondaryTablesListHolder() { - List<ListValueModel<? extends ReadOnlySecondaryTable>> list = new ArrayList<ListValueModel<? extends ReadOnlySecondaryTable>>(); - list.add(buildSpecifiedSecondaryTablesListHolder()); - list.add(buildVirtualSecondaryTablesListHolder()); - return new CompositeListValueModel<ListValueModel<? extends ReadOnlySecondaryTable>, ReadOnlySecondaryTable>(list); - } - - private ListValueModel<ReadOnlySecondaryTable> buildSecondaryTablesListModel() { - return new ItemPropertyListValueModelAdapter<ReadOnlySecondaryTable>(buildSecondaryTablesListHolder(), - ReadOnlyTable.SPECIFIED_NAME_PROPERTY); - } - - private ListValueModel<OrmSecondaryTable> buildSpecifiedSecondaryTablesListHolder() { - return new ListAspectAdapter<OrmEntity, OrmSecondaryTable>(getSubjectHolder(), Entity.SPECIFIED_SECONDARY_TABLES_LIST) { - @Override - protected ListIterator<OrmSecondaryTable> listIterator_() { - return subject.specifiedSecondaryTables(); - } - - @Override - protected int size_() { - return subject.specifiedSecondaryTablesSize(); - } - }; - } - - ListValueModel<OrmVirtualSecondaryTable> buildVirtualSecondaryTablesListHolder() { - return new ListAspectAdapter<OrmEntity, OrmVirtualSecondaryTable>(getSubjectHolder(), OrmEntity.VIRTUAL_SECONDARY_TABLES_LIST) { - @Override - protected ListIterator<OrmVirtualSecondaryTable> listIterator_() { - return this.subject.virtualSecondaryTables(); - } - - @Override - protected int size_() { - return subject.virtualSecondaryTablesSize(); - } - }; - } - - @Override - protected void initializeLayout(Composite container) { - - int groupBoxMargin = getGroupBoxMargin(); - - WritablePropertyValueModel<SecondaryTable> secondaryTableHolder = - buildSecondaryTableHolder(); - - WritablePropertyValueModel<Boolean> defineInXmlHolder = - buildDefineInXmlHolder(); - - // Override Define In XML check box - addCheckBox( - addSubPane(container, 0, groupBoxMargin), - JptUiDetailsMessages.OrmSecondaryTablesComposite_defineInXml, - defineInXmlHolder, - null - ); - - // Secondary Tables add/remove list pane - AddRemoveListPane<Entity> listPane = new AddRemoveListPane<Entity>( - this, - addSubPane(container, 0, groupBoxMargin, 0, groupBoxMargin), - buildSecondaryTablesAdapter(), - buildSecondaryTablesListModel(), - secondaryTableHolder, - buildSecondaryTableLabelProvider(), - JpaHelpContextIds.MAPPING_JOIN_TABLE_COLUMNS//TODO need a help context id for this - ); - - installListPaneEnabler(defineInXmlHolder, listPane); - - // Primary Key Join Columns pane - new PrimaryKeyJoinColumnsInSecondaryTableComposite( - this, - secondaryTableHolder, - container - ); - } - - private void installListPaneEnabler(WritablePropertyValueModel<Boolean> defineInXmlHolder, - AddRemoveListPane<Entity> listPane) { - - new PaneEnabler(defineInXmlHolder, listPane); - } - - @Override - protected SecondaryTableDialog buildSecondaryTableDialogForAdd() { - // defaultSchema and defaultCatalog should not be taken from the Table in this case. - // The table default schema could be what is the specified schema on the java table. - return new SecondaryTableDialog( - getShell(), getSubject().getJpaProject(), - getSubject().getMappingFileRoot().getCatalog(), - getSubject().getMappingFileRoot().getSchema()); - } - - private class DefineInXmlHolder extends ListPropertyValueModelAdapter<Boolean> - implements WritablePropertyValueModel<Boolean> { - - public DefineInXmlHolder() { - super(buildVirtualSecondaryTablesListHolder()); - } - - @Override - protected Boolean buildValue() { - if (getSubject() == null) { - return Boolean.FALSE; - } - return Boolean.valueOf(getSubject().secondaryTablesAreDefinedInXml()); - } - - public void setValue(Boolean value) { - getSubject().setSecondaryTablesAreDefinedInXml(value.booleanValue()); - } - } -}
\ No newline at end of file diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmTransientMappingUiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmTransientMappingUiDefinition.java deleted file mode 100644 index de38367117..0000000000 --- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmTransientMappingUiDefinition.java +++ /dev/null @@ -1,56 +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.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.core.context.orm.OrmTransientMapping; -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.jpt.jpa.ui.internal.details.AbstractTransientMappingUiDefinition; -import org.eclipse.swt.widgets.Composite; - -public class OrmTransientMappingUiDefinition - extends AbstractTransientMappingUiDefinition<ReadOnlyPersistentAttribute, OrmTransientMapping> - implements OrmAttributeMappingUiDefinition<OrmTransientMapping> -{ - // singleton - private static final OrmTransientMappingUiDefinition INSTANCE = - new OrmTransientMappingUiDefinition(); - - - /** - * Return the singleton. - */ - public static OrmAttributeMappingUiDefinition<OrmTransientMapping> instance() { - return INSTANCE; - } - - - /** - * Ensure single instance. - */ - private OrmTransientMappingUiDefinition() { - super(); - } - - - public JpaComposite buildAttributeMappingComposite( - OrmXmlUiFactory factory, - PropertyValueModel<OrmTransientMapping> subjectHolder, - Composite parent, - WidgetFactory widgetFactory) { - - return factory.createOrmTransientMappingComposite(subjectHolder, parent, widgetFactory); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmVersionMappingComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmVersionMappingComposite.java deleted file mode 100644 index af5bb381d1..0000000000 --- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmVersionMappingComposite.java +++ /dev/null @@ -1,41 +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.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.VersionMapping; -import org.eclipse.jpt.jpa.ui.internal.details.AbstractVersionMappingComposite; -import org.eclipse.jpt.jpa.ui.internal.details.ColumnComposite; -import org.eclipse.swt.widgets.Composite; - -public class OrmVersionMappingComposite - extends AbstractVersionMappingComposite<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 OrmVersionMappingComposite(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); - } -}
\ No newline at end of file diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmVersionMappingUiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmVersionMappingUiDefinition.java deleted file mode 100644 index de8d9b3207..0000000000 --- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmVersionMappingUiDefinition.java +++ /dev/null @@ -1,56 +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.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.core.context.orm.OrmVersionMapping; -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.jpt.jpa.ui.internal.details.AbstractVersionMappingUiDefinition; -import org.eclipse.swt.widgets.Composite; - -public class OrmVersionMappingUiDefinition - extends AbstractVersionMappingUiDefinition<ReadOnlyPersistentAttribute, OrmVersionMapping> - implements OrmAttributeMappingUiDefinition<OrmVersionMapping> -{ - // singleton - private static final OrmVersionMappingUiDefinition INSTANCE = - new OrmVersionMappingUiDefinition(); - - - /** - * Return the singleton. - */ - public static OrmAttributeMappingUiDefinition<OrmVersionMapping> instance() { - return INSTANCE; - } - - - /** - * Ensure single instance. - */ - private OrmVersionMappingUiDefinition() { - super(); - } - - - public JpaComposite buildAttributeMappingComposite( - OrmXmlUiFactory factory, - PropertyValueModel<OrmVersionMapping> subjectHolder, - Composite parent, - WidgetFactory widgetFactory) { - - return factory.createOrmVersionMappingComposite(subjectHolder, parent, widgetFactory); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmXmlUiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmXmlUiDefinition.java deleted file mode 100644 index f2758cb785..0000000000 --- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmXmlUiDefinition.java +++ /dev/null @@ -1,84 +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.ui.internal.details.orm; - -import java.util.List; -import org.eclipse.jpt.common.core.JptResourceType; -import org.eclipse.jpt.jpa.core.JptJpaCorePlugin; -import org.eclipse.jpt.jpa.core.context.AttributeMapping; -import org.eclipse.jpt.jpa.core.context.TypeMapping; -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.structure.OrmResourceModelStructureProvider; -import org.eclipse.jpt.jpa.ui.structure.JpaStructureProvider; - -public class OrmXmlUiDefinition extends AbstractOrmXmlResourceUiDefinition -{ - // singleton - private static final ResourceUiDefinition INSTANCE = new OrmXmlUiDefinition(); - - - /** - * Return the singleton - */ - public static ResourceUiDefinition instance() { - return INSTANCE; - } - - - /** - * Enforce singleton usage - */ - private OrmXmlUiDefinition() { - super(); - } - - - @Override - protected OrmXmlUiFactory buildOrmXmlUiFactory() { - return new GenericOrmXmlUiFactory(); - } - - public boolean providesUi(JptResourceType resourceType) { - return resourceType.equals(JptJpaCorePlugin.ORM_XML_1_0_RESOURCE_TYPE); - } - - public JpaStructureProvider getStructureProvider() { - return OrmResourceModelStructureProvider.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()); - } - - @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.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/PersistenceUnitMetadataComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/PersistenceUnitMetadataComposite.java deleted file mode 100644 index cd52166754..0000000000 --- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/PersistenceUnitMetadataComposite.java +++ /dev/null @@ -1,303 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2010 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.jpa.ui.internal.details.orm; - -import java.util.Collection; - -import org.eclipse.jpt.common.ui.internal.utility.swt.SWTTools; -import org.eclipse.jpt.common.ui.internal.widgets.EnumFormComboViewer; -import org.eclipse.jpt.common.ui.internal.widgets.Pane; -import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter; -import org.eclipse.jpt.common.utility.internal.model.value.TransformationPropertyValueModel; -import org.eclipse.jpt.common.utility.model.value.PropertyValueModel; -import org.eclipse.jpt.common.utility.model.value.WritablePropertyValueModel; -import org.eclipse.jpt.jpa.core.JptJpaCorePlugin; -import org.eclipse.jpt.jpa.core.context.AccessType; -import org.eclipse.jpt.jpa.core.context.orm.OrmPersistenceUnitDefaults; -import org.eclipse.jpt.jpa.core.context.orm.OrmPersistenceUnitMetadata; -import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmPersistenceUnitDefaults2_0; -import org.eclipse.jpt.jpa.db.SchemaContainer; -import org.eclipse.jpt.jpa.ui.internal.JpaHelpContextIds; -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.jpa2.Jpa2_0ProjectFlagModel; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; - -/** - * Here the layout of this pane: - * <pre> - * ----------------------------------------------------------------------------- - * | | - * | - Persistence Unit ------------------------------------------------------ | - * | | - * | x XML Mapping Metadata Complete | - * | | - * | x Cascade Persist | - * | | - * | ------------------------------------------------------------ | - * | Schema: | SchemaCombo | | - * | ------------------------------------------------------------ | - * | ------------------------------------------------------------ | - * | Catalog: | CatalogCombo | | - * | ------------------------------------------------------------ | - * | ------------------------------------------------------------ | - * | Access Type: | |v| | - * | ------------------------------------------------------------ | - * -----------------------------------------------------------------------------</pre> - * - * @see PersistenceUnitMetadata - * @see OrmPersistenceUnitDefaults - * @see EntityMappingsDetailsPage - The parent container - * @see CatalogCombo - * @see SchemaCombo - * @see EnumFormComboViewer - * - * @version 2.0 - * @since 2.0 - */ -public class PersistenceUnitMetadataComposite extends Pane<OrmPersistenceUnitMetadata> -{ - /** - * Creates a new <code>PersistenceUnitMetadataComposite</code>. - * - * @param parentPane The parent container of this one - * @param subjectHolder The holder of this pane's subject - * @param parent The parent container - */ - public PersistenceUnitMetadataComposite(Pane<?> parentPane, - PropertyValueModel<? extends OrmPersistenceUnitMetadata> subjectHolder, - Composite parent) { - - super(parentPane, subjectHolder, parent, false); - } - - private EnumFormComboViewer<OrmPersistenceUnitDefaults, AccessType> addAccessTypeCombo(Composite container) { - - return new EnumFormComboViewer<OrmPersistenceUnitDefaults, AccessType>(this, buildPersistenceUnitDefaultsHolder(), container) { - - @Override - protected void addPropertyNames(Collection<String> propertyNames) { - super.addPropertyNames(propertyNames); - propertyNames.add(OrmPersistenceUnitDefaults.ACCESS_PROPERTY); - } - - @Override - protected AccessType[] getChoices() { - return AccessType.values(); - } - - @Override - protected AccessType getDefaultValue() { - return null; - } - - @Override - protected String displayString(AccessType value) { - return buildDisplayString( - JptUiDetailsOrmMessages.class, - PersistenceUnitMetadataComposite.this, - value - ); - } - - @Override - protected AccessType getValue() { - return getSubject().getAccess(); - } - - @Override - protected void setValue(AccessType value) { - getSubject().setAccess(value); - } - }; - } - - private WritablePropertyValueModel<Boolean> buildCascadePersistHolder() { - return new PropertyAspectAdapter<OrmPersistenceUnitDefaults, Boolean>(buildPersistenceUnitDefaultsHolder(), OrmPersistenceUnitDefaults.CASCADE_PERSIST_PROPERTY) { - @Override - protected Boolean buildValue_() { - return Boolean.valueOf(this.subject.isCascadePersist()); - } - - @Override - protected void setValue_(Boolean value) { - this.subject.setCascadePersist(value.booleanValue()); - } - }; - } - - private CatalogCombo<OrmPersistenceUnitDefaults> addCatalogCombo(Composite container) { - - return new CatalogCombo<OrmPersistenceUnitDefaults>(this, buildPersistenceUnitDefaultsHolder(), container) { - - @Override - protected void addPropertyNames(Collection<String> propertyNames) { - super.addPropertyNames(propertyNames); - propertyNames.add(OrmPersistenceUnitDefaults.DEFAULT_CATALOG_PROPERTY); - propertyNames.add(OrmPersistenceUnitDefaults.SPECIFIED_CATALOG_PROPERTY); - } - - @Override - protected String getDefaultValue() { - return getSubject().getDefaultCatalog(); - } - - @Override - protected void setValue(String value) { - getSubject().setSpecifiedCatalog(value); - } - - @Override - protected String getValue() { - return getSubject().getSpecifiedCatalog(); - } - }; - } - - private PropertyValueModel<OrmPersistenceUnitDefaults> buildPersistenceUnitDefaultsHolder() { - return new TransformationPropertyValueModel<OrmPersistenceUnitMetadata, OrmPersistenceUnitDefaults>(getSubjectHolder()) { - @Override - protected OrmPersistenceUnitDefaults transform_(OrmPersistenceUnitMetadata value) { - return value.getPersistenceUnitDefaults(); - } - }; - } - - private SchemaCombo<OrmPersistenceUnitDefaults> addSchemaCombo(Composite container) { - - return new SchemaCombo<OrmPersistenceUnitDefaults>(this, buildPersistenceUnitDefaultsHolder(), container) { - - @Override - protected void addPropertyNames(Collection<String> propertyNames) { - super.addPropertyNames(propertyNames); - propertyNames.add(OrmPersistenceUnitDefaults.DEFAULT_SCHEMA_PROPERTY); - propertyNames.add(OrmPersistenceUnitDefaults.SPECIFIED_SCHEMA_PROPERTY); - } - - @Override - protected String getDefaultValue() { - return getSubject().getDefaultSchema(); - } - - @Override - protected void setValue(String value) { - getSubject().setSpecifiedSchema(value); - } - - @Override - protected String getValue() { - return getSubject().getSpecifiedSchema(); - } - - @Override - protected SchemaContainer getDbSchemaContainer_() { - return this.getSubject().getDbSchemaContainer(); - } - - }; - } - - private WritablePropertyValueModel<Boolean> buildXmlMappingMetadataCompleteHolder() { - return new PropertyAspectAdapter<OrmPersistenceUnitMetadata, Boolean>(getSubjectHolder(), OrmPersistenceUnitMetadata.XML_MAPPING_METADATA_COMPLETE_PROPERTY) { - @Override - protected Boolean buildValue_() { - return Boolean.valueOf(this.subject.isXmlMappingMetadataComplete()); - } - - @Override - protected void setValue_(Boolean value) { - this.subject.setXmlMappingMetadataComplete(value.booleanValue()); - } - }; - } - - private WritablePropertyValueModel<Boolean> buildDelimitedIdentifiersHolder() { - return new PropertyAspectAdapter<OrmPersistenceUnitDefaults, Boolean>(buildPersistenceUnitDefaultsHolder(), OrmPersistenceUnitDefaults2_0.DELIMITED_IDENTIFIERS_PROPERTY) { - @Override - protected Boolean buildValue_() { - return Boolean.valueOf(this.buildBooleanValue_()); - } - - protected boolean buildBooleanValue_() { - return JptJpaCorePlugin.nodeIsJpa2_0Compatible(this.subject) && - ((OrmPersistenceUnitDefaults2_0) this.subject).isDelimitedIdentifiers(); - } - - @Override - protected void setValue_(Boolean value) { - if (JptJpaCorePlugin.nodeIsJpa2_0Compatible(this.subject)) { - ((OrmPersistenceUnitDefaults2_0) this.subject).setDelimitedIdentifiers(value.booleanValue()); - } - } - }; - } - - @Override - protected void initializeLayout(Composite container) { - - // Section - container = addCollapsibleSection( - container, - JptUiDetailsOrmMessages.PersistenceUnitMetadataComposite_persistenceUnitSection - ); - - // XML mapping metadata complete check box - addCheckBox( - container, - JptUiDetailsOrmMessages.PersistenceUnitMetadataComposite_xmlMappingMetadataCompleteCheckBox, - buildXmlMappingMetadataCompleteHolder(), - JpaHelpContextIds.ENTITY_ORM_XML - ); - - // Cascade Persist check-box - addCheckBox( - container, - JptUiDetailsOrmMessages.PersistenceUnitMetadataComposite_cascadePersistCheckBox, - buildCascadePersistHolder(), - JpaHelpContextIds.ENTITY_ORM_CASCADE - ); - - // Schema widgets - addLabeledComposite( - container, - JptUiDetailsOrmMessages.PersistenceUnitMetadataComposite_schema, - addSchemaCombo(container), - JpaHelpContextIds.ENTITY_ORM_SCHEMA - ); - - // Catalog widgets - addLabeledComposite( - container, - JptUiDetailsOrmMessages.PersistenceUnitMetadataComposite_catalog, - addCatalogCombo(container), - JpaHelpContextIds.ENTITY_ORM_CATALOG - ); - - // Access Type widgets - addLabeledComposite( - container, - JptUiDetailsOrmMessages.PersistenceUnitMetadataComposite_access, - addAccessTypeCombo(container), - JpaHelpContextIds.ENTITY_ORM_ACCESS - ); - - // Delimited Identifiers check-box - Button diCheckBox = this.addCheckBox( - container, - JptUiDetailsOrmMessages.PersistenceUnitMetadataComposite_delimitedIdentifiersCheckBox, - this.buildDelimitedIdentifiersHolder(), - JpaHelpContextIds.ENTITY_ORM_DELIMITED_IDENTIFIERS - ); - - SWTTools.controlVisibleState(new Jpa2_0ProjectFlagModel<OrmPersistenceUnitMetadata>(this.getSubjectHolder()), diCheckBox); - - } -} diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/UnsupportedOrmMappingUiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/UnsupportedOrmMappingUiDefinition.java deleted file mode 100644 index d4a0f788e0..0000000000 --- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/UnsupportedOrmMappingUiDefinition.java +++ /dev/null @@ -1,89 +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.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.java.JavaAttributeMapping; -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.jpt.jpa.ui.internal.JpaMappingImageHelper; -import org.eclipse.jpt.jpa.ui.internal.details.AbstractMappingUiDefinition; -import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.widgets.Composite; - -public class UnsupportedOrmMappingUiDefinition - extends AbstractMappingUiDefinition - implements OrmAttributeMappingUiDefinition -{ - // singleton - private static final UnsupportedOrmMappingUiDefinition INSTANCE = - new UnsupportedOrmMappingUiDefinition(); - - - /** - * Return the singleton. - */ - public static OrmAttributeMappingUiDefinition instance() { - return INSTANCE; - } - - - /** - * Ensure single instance. - */ - private UnsupportedOrmMappingUiDefinition() { - super(); - } - - - public Image getImage() { - return JpaMappingImageHelper.imageForAttributeMapping(getKey()); - } - - public String getLabel() { - return JptUiDetailsOrmMessages.UnsupportedOrmMappingUiProvider_label; - } - - public String getLinkLabel() { - return JptUiDetailsOrmMessages.UnsupportedOrmMappingUiProvider_linkLabel; - } - - public String getKey() { - return null; - } - - public JpaComposite buildAttributeMappingComposite( - OrmXmlUiFactory factory, - PropertyValueModel subjectHolder, - Composite parent, - WidgetFactory widgetFactory) { - - return new NullComposite(subjectHolder, parent, widgetFactory); - } - - public static class NullComposite extends Pane<JavaAttributeMapping> - implements JpaComposite - { - NullComposite( - PropertyValueModel<JavaAttributeMapping> subjectHolder, - Composite parent, - WidgetFactory widgetFactory) { - - super(subjectHolder, parent, widgetFactory); - } - - - @Override - protected void initializeLayout(Composite container) {} - } -} |