diff options
author | kmoore | 2012-03-15 02:32:36 +0000 |
---|---|---|
committer | kmoore | 2012-03-15 02:32:36 +0000 |
commit | ce76d9e7cda329e98f4600b76ff930171f261160 (patch) | |
tree | a3fc08f9a8526930c07275683e9fa8401035e291 /jpa | |
parent | 438f54ba6ee6c87f104e9909f627924a393d7a6a (diff) | |
download | webtools.dali-ce76d9e7cda329e98f4600b76ff930171f261160.tar.gz webtools.dali-ce76d9e7cda329e98f4600b76ff930171f261160.tar.xz webtools.dali-ce76d9e7cda329e98f4600b76ff930171f261160.zip |
Bug 370497 - [EclipseLink] JPA Details add attribute-type class chooser widgets
Diffstat (limited to 'jpa')
23 files changed, 251 insertions, 21 deletions
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/property_files/eclipselink_ui_details.properties b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/property_files/eclipselink_ui_details.properties index 12ad80a290..28b41f7c90 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/property_files/eclipselink_ui_details.properties +++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/property_files/eclipselink_ui_details.properties @@ -168,3 +168,4 @@ EclipseLinkMultitenancyComposite_includeCriteriaWithDefault=Include criteria ({0 EclipseLinkConvertersComposite_maxConvertersErrorMessage=Maximum number of converters supported on this element is {0}. +OrmAttributeTypeComposite_attributeType=Attribute type: diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkUiDetailsMessages.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkUiDetailsMessages.java index 7d8d886c9d..1cfb87b759 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkUiDetailsMessages.java +++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkUiDetailsMessages.java @@ -176,6 +176,8 @@ public class EclipseLinkUiDetailsMessages extends NLS { public static String EclipseLinkMultitenancyComposite_includeCriteria; public static String EclipseLinkMultitenancyComposite_includeCriteriaWithDefault; + public static String OrmAttributeTypeComposite_attributeType; + static { NLS.initializeMessages("eclipselink_ui_details", EclipseLinkUiDetailsMessages.class); } diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkOrmXml2_0UiFactory.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkOrmXml2_0UiFactory.java index dd28600cd2..ae64260644 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkOrmXml2_0UiFactory.java +++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkOrmXml2_0UiFactory.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2011 Oracle. All rights reserved. + * Copyright (c) 2007, 2012 Oracle. All rights reserved. * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v1.0, which accompanies this distribution * and is available at http://www.eclipse.org/legal/epl-v10.html. @@ -24,7 +24,6 @@ import org.eclipse.jpt.jpa.core.context.orm.OrmOneToOneMapping; import org.eclipse.jpt.jpa.core.context.orm.OrmVersionMapping; import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmElementCollectionMapping2_0; import org.eclipse.jpt.jpa.ui.details.JpaComposite; -import org.eclipse.jpt.jpa.ui.internal.jpa2.details.orm.OrmEmbeddedMapping2_0Composite; import org.eclipse.jpt.jpa.ui.jpa2.details.orm.OrmXmlUiFactory2_0; import org.eclipse.swt.widgets.Composite; @@ -63,7 +62,7 @@ public class EclipseLinkOrmXml2_0UiFactory PropertyValueModel<OrmEmbeddedMapping> subjectHolder, Composite parent, WidgetFactory widgetFactory) { - return new OrmEmbeddedMapping2_0Composite(subjectHolder, parent, widgetFactory); + return new OrmEclipseLinkEmbeddedMapping2_0Composite(subjectHolder, parent, widgetFactory); } @Override diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmAttributeTypeComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmAttributeTypeComposite.java new file mode 100644 index 0000000000..fa6755dc24 --- /dev/null +++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmAttributeTypeComposite.java @@ -0,0 +1,133 @@ +/******************************************************************************* + * Copyright (c) 2012 Oracle. All rights reserved. + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0, which accompanies this distribution + * and is available at http://www.eclipse.org/legal/epl-v10.html. + * + * Contributors: + * Oracle - initial API and implementation + ******************************************************************************/ +package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm; + +import org.eclipse.jdt.core.IJavaProject; +import org.eclipse.jdt.internal.ui.refactoring.contentassist.JavaTypeCompletionProcessor; +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.ModifiablePropertyValueModel; +import org.eclipse.jpt.common.utility.model.value.PropertyValueModel; +import org.eclipse.jpt.jpa.core.context.AccessHolder; +import org.eclipse.jpt.jpa.core.context.AttributeMapping; +import org.eclipse.jpt.jpa.core.context.orm.OrmAttributeMapping; +import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkAccessType; +import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkUiDetailsMessages; +import org.eclipse.swt.widgets.Composite; + +public class OrmAttributeTypeComposite + extends ClassChooserPane<AttributeMapping> +{ + public OrmAttributeTypeComposite(Pane<?> parentPane, + PropertyValueModel<? extends AttributeMapping> subjectHolder, + Composite parent) { + + this(parentPane, subjectHolder, parent, buildVirtualAttributeModel(subjectHolder)); + } + + public OrmAttributeTypeComposite(Pane<?> parentPane, + PropertyValueModel<? extends AttributeMapping> subjectHolder, + Composite parent, + PropertyValueModel<Boolean> enabledModel) { + + super(parentPane, subjectHolder, parent, enabledModel); + } + + @Override + public void enableWidgets(boolean enabled) { + // TODO Auto-generated method stub + super.enableWidgets(enabled); + } + @Override + protected JavaTypeCompletionProcessor buildJavaTypeCompletionProcessor() { + return new JavaTypeCompletionProcessor(true, true); + } + + @Override + protected String getLabelText() { + return EclipseLinkUiDetailsMessages.OrmAttributeTypeComposite_attributeType; + } + + @Override + protected ModifiablePropertyValueModel<String> buildTextHolder() { + return new PropertyAspectAdapter<AttributeMapping, String>( + getSubjectHolder(), + OrmAttributeMapping.DEFAULT_ATTRIBUTE_TYPE_PROPERTY, + OrmAttributeMapping.SPECIFIED_ATTRIBUTE_TYPE_PROPERTY) { + @Override + protected String buildValue_() { + if (this.subject.getPersistentAttribute().isVirtual()) { + return this.subject.getPersistentAttribute().getTypeName(); + } + //get the attributeType instead of the specifiedAttributeType. + //this widget will only be enabled if the mapping is VIRTUAL access + //so we don't need to display the default differently + return ((OrmAttributeMapping) this.subject).getAttributeType(); + } + + @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).setSpecifiedAttributeType(value); + } + }; + } + + @Override + protected String getClassName() { + return ((OrmAttributeMapping) getSubject()).getAttributeType(); + } + + @Override + protected void setClassName(String className) { + ((OrmAttributeMapping) getSubject()).setSpecifiedAttributeType(className); + } + + @Override + protected IJavaProject getJavaProject() { + return getSubject().getJpaProject().getJavaProject(); + } + + private static PropertyValueModel<AccessHolder> buildAccessHolderHolder(PropertyValueModel<? extends AttributeMapping> mappingHolder) { + return new PropertyAspectAdapter<AttributeMapping, AccessHolder>(mappingHolder) { + @Override + protected AccessHolder buildValue_() { + return this.subject.getPersistentAttribute(); + } + }; + } + + private static PropertyValueModel<Boolean> buildVirtualAttributeModel(PropertyValueModel<? extends AttributeMapping> mappingHolder) { + return new PropertyAspectAdapter<AccessHolder, Boolean>( + buildAccessHolderHolder(mappingHolder), + AccessHolder.SPECIFIED_ACCESS_PROPERTY, + AccessHolder.DEFAULT_ACCESS_PROPERTY) { + @Override + protected Boolean buildValue() { + if (this.subject == null) { + return Boolean.FALSE; + } + return this.buildValue_(); + } + @Override + protected Boolean buildValue_() { + return Boolean.valueOf(this.subject.getAccess() == EclipseLinkAccessType.VIRTUAL); + } + }; + } + +}
\ No newline at end of file diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkBasicMapping1_1Composite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkBasicMapping1_1Composite.java index ff261b14d5..45d8dbfac9 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkBasicMapping1_1Composite.java +++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkBasicMapping1_1Composite.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009, 2011 Oracle. All rights reserved. + * Copyright (c) 2009, 2012 Oracle. All rights reserved. * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v1.0, which accompanies this distribution * and is available at http://www.eclipse.org/legal/epl-v10.html. @@ -50,12 +50,13 @@ public class OrmEclipseLinkBasicMapping1_1Composite extends EclipseLinkBasicMapp protected void initializeBasicSection(Composite container) { new ColumnComposite(this, buildColumnHolder(), container); new OrmMappingNameChooser(this, getSubjectHolder(), container); + new OrmAttributeTypeComposite(this, getSubjectHolder(), container); new AccessTypeComposite(this, buildAccessHolderHolder(), container); new FetchTypeComposite(this, container); new OptionalComposite(this, addSubPane(container, 4)); new EclipseLinkMutableComposite(this, buildMutableHolder(), container); } - + protected PropertyValueModel<AccessHolder> buildAccessHolderHolder() { return new PropertyAspectAdapter<BasicMapping, AccessHolder>(getSubjectHolder()) { @Override @@ -64,5 +65,4 @@ public class OrmEclipseLinkBasicMapping1_1Composite extends EclipseLinkBasicMapp } }; } - }
\ No newline at end of file diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkBasicMappingComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkBasicMappingComposite.java index 8b873f6652..8b1fc2234d 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkBasicMappingComposite.java +++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkBasicMappingComposite.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008, 2011 Oracle. All rights reserved. + * Copyright (c) 2008, 2012 Oracle. All rights reserved. * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v1.0, which accompanies this distribution * and is available at http://www.eclipse.org/legal/epl-v10.html. @@ -40,6 +40,7 @@ public class OrmEclipseLinkBasicMappingComposite extends EclipseLinkBasicMapping protected void initializeBasicSection(Composite container) { new ColumnComposite(this, buildColumnHolder(), container); new OrmMappingNameChooser(this, getSubjectHolder(), container); + new OrmAttributeTypeComposite(this, getSubjectHolder(), container); new FetchTypeComposite(this, container); new OptionalComposite(this, addSubPane(container, 4)); new EclipseLinkMutableComposite(this, buildMutableHolder(), container); diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkElementCollectionMapping2_0Composite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkElementCollectionMapping2_0Composite.java index 00a636e14d..cc53250494 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkElementCollectionMapping2_0Composite.java +++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkElementCollectionMapping2_0Composite.java @@ -53,6 +53,7 @@ public class OrmEclipseLinkElementCollectionMapping2_0Composite protected void initializeElementCollectionSection(Composite container) { new TargetClassComposite(this, container); new OrmMappingNameChooser(this, getSubjectHolder(), container); + new OrmAttributeTypeComposite(this, getSubjectHolder(), container); new AccessTypeComposite(this, buildAccessHolderHolder(), container); new FetchTypeComposite(this, container); new CollectionTable2_0Composite(this, buildCollectionTableHolder(), container); diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkElementCollectionMapping2_1Composite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkElementCollectionMapping2_1Composite.java index f22e7ad79a..b7026f07f9 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkElementCollectionMapping2_1Composite.java +++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkElementCollectionMapping2_1Composite.java @@ -56,6 +56,7 @@ public class OrmEclipseLinkElementCollectionMapping2_1Composite protected void initializeElementCollectionSection(Composite container) { new TargetClassComposite(this, container); new OrmMappingNameChooser(this, getSubjectHolder(), container); + new OrmAttributeTypeComposite(this, getSubjectHolder(), container); new AccessTypeComposite(this, buildAccessHolderHolder(), container); new FetchTypeComposite(this, container); new EclipseLinkJoinFetchComposite(this, buildJoinFetchHolder(), container); diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkEmbeddedIdMapping1_1Composite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkEmbeddedIdMapping1_1Composite.java index 21f0574c9c..2a5ccdade8 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkEmbeddedIdMapping1_1Composite.java +++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkEmbeddedIdMapping1_1Composite.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009, 2011 Oracle. All rights reserved. + * Copyright (c) 2009, 2012 Oracle. All rights reserved. * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v1.0, which accompanies this distribution * and is available at http://www.eclipse.org/legal/epl-v10.html. @@ -35,6 +35,7 @@ public class OrmEclipseLinkEmbeddedIdMapping1_1Composite @Override protected void initializeEmbeddedIdSection(Composite container) { new OrmMappingNameChooser(this, getSubjectHolder(), container); + new OrmAttributeTypeComposite(this, getSubjectHolder(), container); new AccessTypeComposite(this, buildAccessHolderHolder(), container); new EmbeddedMappingOverridesComposite( diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkEmbeddedIdMapping2_0Composite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkEmbeddedIdMapping2_0Composite.java index 26a5421c5e..8933f37b3d 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkEmbeddedIdMapping2_0Composite.java +++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkEmbeddedIdMapping2_0Composite.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2010, 2011 Oracle. + * Copyright (c) 2010, 2012 Oracle. * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v1.0 which * accompanies this distribution, and is available at @@ -34,6 +34,7 @@ public class OrmEclipseLinkEmbeddedIdMapping2_0Composite @Override protected void initializeEmbeddedIdSection(Composite container) { new OrmMappingNameChooser(this, getSubjectHolder(), container); + new OrmAttributeTypeComposite(this, getSubjectHolder(), container); new AccessTypeComposite(this, buildAccessHolderHolder(), container); new EmbeddedIdMapping2_0MappedByRelationshipPane(this, getSubjectHolder(), container); diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkEmbeddedMapping1_1Composite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkEmbeddedMapping1_1Composite.java index e238765368..84af284756 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkEmbeddedMapping1_1Composite.java +++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkEmbeddedMapping1_1Composite.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009, 2011 Oracle. All rights reserved. + * Copyright (c) 2009, 2012 Oracle. All rights reserved. * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v1.0, which accompanies this distribution * and is available at http://www.eclipse.org/legal/epl-v10.html. @@ -56,6 +56,7 @@ public class OrmEclipseLinkEmbeddedMapping1_1Composite @Override protected void initializeEmbeddedSection(Composite container) { new OrmMappingNameChooser(this, getSubjectHolder(), container); + new OrmAttributeTypeComposite(this, getSubjectHolder(), container); new AccessTypeComposite(this, buildAccessHolderHolder(), container); new EmbeddedMappingOverridesComposite( diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkEmbeddedMapping2_0Composite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkEmbeddedMapping2_0Composite.java new file mode 100644 index 0000000000..2c5f5987ec --- /dev/null +++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkEmbeddedMapping2_0Composite.java @@ -0,0 +1,78 @@ +/******************************************************************************* + * Copyright (c) 2012 Oracle. All rights reserved. + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0, which accompanies this distribution + * and is available at http://www.eclipse.org/legal/epl-v10.html. + * + * Contributors: + * Oracle - initial API and implementation + ******************************************************************************/ +package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm; + +import org.eclipse.jpt.common.ui.WidgetFactory; +import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter; +import org.eclipse.jpt.common.utility.model.value.PropertyValueModel; +import org.eclipse.jpt.jpa.core.context.AccessHolder; +import org.eclipse.jpt.jpa.core.context.EmbeddedMapping; +import org.eclipse.jpt.jpa.ui.internal.details.AbstractEmbeddedMappingComposite; +import org.eclipse.jpt.jpa.ui.internal.details.AccessTypeComposite; +import org.eclipse.jpt.jpa.ui.internal.details.java.BaseJavaUiFactory; +import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmMappingNameChooser; +import org.eclipse.jpt.jpa.ui.internal.jpa2.details.EmbeddedMapping2_0OverridesComposite; +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 OrmEclipseLinkEmbeddedMapping2_0Composite + 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 OrmEclipseLinkEmbeddedMapping2_0Composite(PropertyValueModel<? extends EmbeddedMapping> subjectHolder, + Composite parent, + WidgetFactory widgetFactory) { + + super(subjectHolder, parent, widgetFactory); + } + + @Override + protected void initializeEmbeddedSection(Composite container) { + new OrmMappingNameChooser(this, getSubjectHolder(), container); + new OrmAttributeTypeComposite(this, getSubjectHolder(), container); + new AccessTypeComposite(this, buildAccessHolderHolder(), container); + + new EmbeddedMapping2_0OverridesComposite( + this, + container + ); + } + + protected PropertyValueModel<AccessHolder> buildAccessHolderHolder() { + return new PropertyAspectAdapter<EmbeddedMapping, AccessHolder>(getSubjectHolder()) { + @Override + protected AccessHolder buildValue_() { + return this.subject.getPersistentAttribute(); + } + }; + } +}
\ No newline at end of file diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkIdMapping1_1Composite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkIdMapping1_1Composite.java index 34022edcaf..4c576c790c 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkIdMapping1_1Composite.java +++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkIdMapping1_1Composite.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009, 2011 Oracle. All rights reserved. + * Copyright (c) 2009, 2012 Oracle. All rights reserved. * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v1.0, which accompanies this distribution * and is available at http://www.eclipse.org/legal/epl-v10.html. @@ -45,6 +45,7 @@ public class OrmEclipseLinkIdMapping1_1Composite protected void initializeIdSection(Composite container) { new ColumnComposite(this, buildColumnHolder(), container); new OrmMappingNameChooser(this, getSubjectHolder(), container); + new OrmAttributeTypeComposite(this, getSubjectHolder(), container); new AccessTypeComposite(this, buildAccessHolderHolder(), container); new EclipseLinkMutableComposite(this, buildMutableHolder(), container); } diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkIdMapping2_0Composite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkIdMapping2_0Composite.java index 0c6c2fc24e..ad00b36d8d 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkIdMapping2_0Composite.java +++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkIdMapping2_0Composite.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009, 2011 Oracle. All rights reserved. + * Copyright (c) 2009, 2012 Oracle. All rights reserved. * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v1.0, which accompanies this distribution * and is available at http://www.eclipse.org/legal/epl-v10.html. @@ -37,6 +37,7 @@ public class OrmEclipseLinkIdMapping2_0Composite new IdMapping2_0MappedByRelationshipPane(this, getSubjectHolder(), container); new ColumnComposite(this, buildColumnHolder(), container); new OrmMappingNameChooser(this, getSubjectHolder(), container); + new OrmAttributeTypeComposite(this, getSubjectHolder(), container); new AccessTypeComposite(this, buildAccessHolderHolder(), container); new EclipseLinkMutableComposite(this, buildMutableHolder(), container); } diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkIdMappingComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkIdMappingComposite.java index 523f2e7db6..83fe510fb0 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkIdMappingComposite.java +++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkIdMappingComposite.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008, 2011 Oracle. All rights reserved. + * Copyright (c) 2008, 2012 Oracle. All rights reserved. * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v1.0, which accompanies this distribution * and is available at http://www.eclipse.org/legal/epl-v10.html. @@ -33,6 +33,7 @@ public class OrmEclipseLinkIdMappingComposite protected void initializeIdSection(Composite container) { new ColumnComposite(this, buildColumnHolder(), container); new OrmMappingNameChooser(this, getSubjectHolder(), container); + new OrmAttributeTypeComposite(this, getSubjectHolder(), container); new EclipseLinkMutableComposite(this, buildMutableHolder(), container); } } diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkManyToManyMapping1_1Composite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkManyToManyMapping1_1Composite.java index 8eb9b665ee..3cef067c46 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkManyToManyMapping1_1Composite.java +++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkManyToManyMapping1_1Composite.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009, 2011 Oracle. All rights reserved. + * Copyright (c) 2009, 2012 Oracle. All rights reserved. * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v1.0, which accompanies this distribution * and is available at http://www.eclipse.org/legal/epl-v10.html. @@ -86,6 +86,7 @@ public class OrmEclipseLinkManyToManyMapping1_1Composite protected void initializeManyToManySection(Composite container) { new TargetEntityComposite(this, container); new OrmMappingNameChooser(this, getSubjectHolder(), container); + new OrmAttributeTypeComposite(this, getSubjectHolder(), container); new AccessTypeComposite(this, buildAccessHolderHolder(), container); new FetchTypeComposite(this, container); new EclipseLinkJoinFetchComposite(this, buildJoinFetchableHolder(), container); diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkManyToManyMapping2_0Composite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkManyToManyMapping2_0Composite.java index 269dd51d05..5caa9bf269 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkManyToManyMapping2_0Composite.java +++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkManyToManyMapping2_0Composite.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009, 2011 Oracle. All rights reserved. + * Copyright (c) 2009, 2012 Oracle. All rights reserved. * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v1.0, which accompanies this distribution * and is available at http://www.eclipse.org/legal/epl-v10.html. @@ -45,6 +45,7 @@ public class OrmEclipseLinkManyToManyMapping2_0Composite protected void initializeManyToManySection(Composite container) { new TargetEntityComposite(this, container); new OrmMappingNameChooser(this, getSubjectHolder(), container); + new OrmAttributeTypeComposite(this, getSubjectHolder(), container); new AccessTypeComposite(this, buildAccessHolderHolder(), container); new FetchTypeComposite(this, container); new EclipseLinkJoinFetchComposite(this, buildJoinFetchableHolder(), container); diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkManyToManyMappingComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkManyToManyMappingComposite.java index 6ff34d465c..54ecddc9f1 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkManyToManyMappingComposite.java +++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkManyToManyMappingComposite.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2010 Oracle. All rights reserved. + * Copyright (c) 2010, 2012 Oracle. All rights reserved. * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v1.0, which accompanies this distribution * and is available at http://www.eclipse.org/legal/epl-v10.html. @@ -85,6 +85,7 @@ public class OrmEclipseLinkManyToManyMappingComposite protected void initializeManyToManySection(Composite container) { new TargetEntityComposite(this, container); new OrmMappingNameChooser(this, getSubjectHolder(), container); + new OrmAttributeTypeComposite(this, getSubjectHolder(), container); new FetchTypeComposite(this, container); new EclipseLinkJoinFetchComposite(this, buildJoinFetchableHolder(), container); new CascadeComposite(this, buildCascadeHolder(), addSubPane(container, 5)); diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkOneToManyMapping1_1Composite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkOneToManyMapping1_1Composite.java index b046d60441..e89de26f6c 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkOneToManyMapping1_1Composite.java +++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkOneToManyMapping1_1Composite.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009, 2011 Oracle. All rights reserved. + * Copyright (c) 2009, 2012 Oracle. All rights reserved. * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v1.0, which accompanies this distribution * and is available at http://www.eclipse.org/legal/epl-v10.html. @@ -39,6 +39,7 @@ public class OrmEclipseLinkOneToManyMapping1_1Composite protected void initializeOneToManySection(Composite container) { new TargetEntityComposite(this, container); new OrmMappingNameChooser(this, getSubjectHolder(), container); + new OrmAttributeTypeComposite(this, getSubjectHolder(), container); new AccessTypeComposite(this, buildAccessHolderHolder(), container); new FetchTypeComposite(this, container); new EclipseLinkJoinFetchComposite(this, buildJoinFetchableHolder(), container); diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkOneToManyMapping2_0Composite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkOneToManyMapping2_0Composite.java index 309300ea39..697b7fe60c 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkOneToManyMapping2_0Composite.java +++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkOneToManyMapping2_0Composite.java @@ -1,5 +1,5 @@ /******************************************************************************* -* Copyright (c) 2009, 2011 Oracle. All rights reserved. +* Copyright (c) 2009, 2012 Oracle. All rights reserved. * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v1.0, which accompanies this distribution * and is available at http://www.eclipse.org/legal/epl-v10.html. @@ -53,6 +53,7 @@ public class OrmEclipseLinkOneToManyMapping2_0Composite protected void initializeOneToManySection(Composite container) { new TargetEntityComposite(this, container); new OrmMappingNameChooser(this, getSubjectHolder(), container); + new OrmAttributeTypeComposite(this, getSubjectHolder(), container); new AccessTypeComposite(this, this.buildAccessHolderHolder(), container); new FetchTypeComposite(this, container); new EclipseLinkJoinFetchComposite(this, this.buildJoinFetchableHolder(), container); diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkOneToManyMappingComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkOneToManyMappingComposite.java index 36ffb7e3b0..9d3114dd56 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkOneToManyMappingComposite.java +++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkOneToManyMappingComposite.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2010 Oracle. All rights reserved. + * Copyright (c) 2010, 2012 Oracle. All rights reserved. * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v1.0, which accompanies this distribution * and is available at http://www.eclipse.org/legal/epl-v10.html. @@ -38,6 +38,7 @@ public class OrmEclipseLinkOneToManyMappingComposite protected void initializeOneToManySection(Composite container) { new TargetEntityComposite(this, container); new OrmMappingNameChooser(this, getSubjectHolder(), container); + new OrmAttributeTypeComposite(this, getSubjectHolder(), container); new FetchTypeComposite(this, container); new EclipseLinkJoinFetchComposite(this, buildJoinFetchableHolder(), container); new EclipseLinkPrivateOwnedComposite(this, buildPrivateOwnableHolder(), container); diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkVersionMapping1_1Composite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkVersionMapping1_1Composite.java index f8f10e7cfc..52f9b576af 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkVersionMapping1_1Composite.java +++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkVersionMapping1_1Composite.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009, 2011 Oracle. All rights reserved. + * Copyright (c) 2009, 2012 Oracle. All rights reserved. * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v1.0, which accompanies this distribution * and is available at http://www.eclipse.org/legal/epl-v10.html. @@ -49,6 +49,7 @@ public class OrmEclipseLinkVersionMapping1_1Composite protected void initializeVersionSection(Composite container) { new ColumnComposite(this, buildColumnHolder(), container); new OrmMappingNameChooser(this, getSubjectHolder(), container); + new OrmAttributeTypeComposite(this, getSubjectHolder(), container); new AccessTypeComposite(this, buildAccessHolderHolder(), container); new EclipseLinkMutableComposite(this, buildMutableHolder(), container); } diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkVersionMappingComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkVersionMappingComposite.java index 4a8b52a1aa..2935f682e2 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkVersionMappingComposite.java +++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkVersionMappingComposite.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008, 2011 Oracle. All rights reserved. + * Copyright (c) 2008, 2012 Oracle. All rights reserved. * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v1.0, which accompanies this distribution * and is available at http://www.eclipse.org/legal/epl-v10.html. @@ -39,6 +39,7 @@ public class OrmEclipseLinkVersionMappingComposite protected void initializeVersionSection(Composite container) { new ColumnComposite(this, buildColumnHolder(), container); new OrmMappingNameChooser(this, getSubjectHolder(), container); + new OrmAttributeTypeComposite(this, getSubjectHolder(), container); new EclipseLinkMutableComposite(this, buildMutableHolder(), container); } }
\ No newline at end of file |