diff options
Diffstat (limited to 'jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details')
53 files changed, 0 insertions, 5070 deletions
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/AbstractElementCollectionMapping2_0Composite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/AbstractElementCollectionMapping2_0Composite.java deleted file mode 100644 index 9ced1196ea..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/AbstractElementCollectionMapping2_0Composite.java +++ /dev/null @@ -1,360 +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.ui.internal.jpa2.details; - -import org.eclipse.jpt.core.context.BasicMapping; -import org.eclipse.jpt.core.context.Column; -import org.eclipse.jpt.core.context.Converter; -import org.eclipse.jpt.core.context.ConvertibleMapping; -import org.eclipse.jpt.core.context.EnumeratedConverter; -import org.eclipse.jpt.core.context.TemporalConverter; -import org.eclipse.jpt.core.jpa2.context.CollectionTable2_0; -import org.eclipse.jpt.core.jpa2.context.ElementCollectionMapping2_0; -import org.eclipse.jpt.ui.WidgetFactory; -import org.eclipse.jpt.ui.details.JpaComposite; -import org.eclipse.jpt.ui.internal.details.ColumnComposite; -import org.eclipse.jpt.ui.internal.details.EnumTypeComposite; -import org.eclipse.jpt.ui.internal.details.FetchTypeComposite; -import org.eclipse.jpt.ui.internal.details.JptUiDetailsMessages; -import org.eclipse.jpt.ui.internal.details.TemporalTypeComposite; -import org.eclipse.jpt.ui.internal.util.ControlSwitcher; -import org.eclipse.jpt.ui.internal.widgets.Pane; -import org.eclipse.jpt.utility.internal.Transformer; -import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter; -import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel; -import org.eclipse.jpt.utility.internal.model.value.TransformationPropertyValueModel; -import org.eclipse.jpt.utility.model.value.PropertyValueModel; -import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel; -import org.eclipse.swt.SWT; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.ui.part.PageBook; - -/** - * Here the layout of this pane: - * <pre> - * ----------------------------------------------------------------------------- - * | ------------------------------------------------------------------------- | - * | | | | - * | | ColumnComposite | | - * | | | | - * | ------------------------------------------------------------------------- | - * | ------------------------------------------------------------------------- | - * | | | | - * | | FetchTypeComposite | | - * | | | | - * | ------------------------------------------------------------------------- | - * | ------------------------------------------------------------------------- | - * | | | | - * | | TemporalTypeComposite | | - * | | | | - * | ------------------------------------------------------------------------- | - * | ------------------------------------------------------------------------- | - * | | | | - * | | EnumTypeComposite | | - * | | | | - * | ------------------------------------------------------------------------- | - * | ------------------------------------------------------------------------- | - * | | | | - * | | OptionalComposite | | - * | | | | - * | ------------------------------------------------------------------------- | - * | ------------------------------------------------------------------------- | - * | | | | - * | | LobComposite | | - * | | | | - * | ------------------------------------------------------------------------- | - * -----------------------------------------------------------------------------</pre> - * - * @see BasicMapping - * @see OrderColumnComposite - * @see EnumTypeComposite - * @see FetchTypeComposite - * @see LobComposite - * @see OptionalComposite - * @see TemporalTypeComposite - * - * @version 2.3 - * @since 2.3 - */ -public abstract class AbstractElementCollectionMapping2_0Composite<T extends ElementCollectionMapping2_0> - extends Pane<T> - implements JpaComposite -{ - - private Composite basicValueComposite; - - private Composite embeddableValueComposite; - - /** - * Creates a new <code>BasicMappingComposite</code>. - * - * @param subjectHolder The holder of the subject <code>IBasicMapping</code> - * @param parent The parent container - * @param widgetFactory The factory used to create various common widgets - */ - protected AbstractElementCollectionMapping2_0Composite(PropertyValueModel<? extends T> subjectHolder, - Composite parent, - WidgetFactory widgetFactory) { - - super(subjectHolder, parent, widgetFactory); - } - - @Override - protected void initializeLayout(Composite container) { - initializeGeneralPane(container); - this.initializeValuePane(container); - this.initializeKeyPane(container); - new Ordering2_0Composite(this, container); - } - - protected void initializeGeneralPane(Composite container) { - int groupBoxMargin = this.getGroupBoxMargin(); - new TargetClassComposite(this, this.addPane(container, groupBoxMargin)); - new FetchTypeComposite(this, this.addPane(container, groupBoxMargin)); - new CollectionTable2_0Composite(this, buildCollectionTableHolder(), container); - } - - protected void initializeValuePane(Composite container) { - Composite valueSection = addCollapsibleSection( - container, - JptUiDetailsMessages2_0.AbstractElementCollectionMapping2_0_Composite_valueSectionTitle - ); - PageBook pageBook = new PageBook(valueSection, SWT.NULL); - GridData gd = new GridData(GridData.FILL_HORIZONTAL); - gd.horizontalIndent = 5; - pageBook.setLayoutData(gd); - - this.initializeBasicValueSection(pageBook); - this.initializeEmbeddableValueSection(pageBook); - - installValueControlSwitcher(pageBook); - } - - protected void initializeBasicValueSection(Composite container) { - this.basicValueComposite = addSubPane(container); - - new ColumnComposite(this, buildValueColumnHolder(), this.basicValueComposite); - - // type section - Composite converterSection = addCollapsibleSubSection( - this.basicValueComposite, - JptUiDetailsMessages.TypeSection_type, - new SimplePropertyValueModel<Boolean>(Boolean.FALSE) - ); - ((GridLayout) converterSection.getLayout()).numColumns = 2; - - // No converter - Button noConverterButton = addRadioButton( - converterSection, - JptUiDetailsMessages.TypeSection_default, - buildNoConverterHolder(), - null); - ((GridData) noConverterButton.getLayoutData()).horizontalSpan = 2; - - // Lob - Button lobButton = addRadioButton( - converterSection, - JptUiDetailsMessages.TypeSection_lob, - buildLobConverterHolder(), - null); - ((GridData) lobButton.getLayoutData()).horizontalSpan = 2; - - - PropertyValueModel<Converter> converterHolder = buildConverterHolder(); - // Temporal - addRadioButton( - converterSection, - JptUiDetailsMessages.TypeSection_temporal, - buildTemporalBooleanHolder(), - null); - registerSubPane(new TemporalTypeComposite(buildTemporalConverterHolder(converterHolder), converterSection, getWidgetFactory())); - - - // Enumerated - addRadioButton( - converterSection, - JptUiDetailsMessages.TypeSection_enumerated, - buildEnumeratedBooleanHolder(), - null); - registerSubPane(new EnumTypeComposite(buildEnumeratedConverterHolder(converterHolder), converterSection, getWidgetFactory())); - } - - protected void initializeEmbeddableValueSection(Composite container) { - this.embeddableValueComposite = new ElementCollectionValueOverridesComposite(this, container).getControl(); - } - - private void installValueControlSwitcher(PageBook pageBook) { - - new ControlSwitcher( - buildValueHolder(), - buildPaneTransformer(), - pageBook - ); - } - - protected PropertyValueModel<ElementCollectionMapping2_0.Type> buildValueHolder() { - return new PropertyAspectAdapter<T, ElementCollectionMapping2_0.Type>( - this.getSubjectHolder(), ElementCollectionMapping2_0.VALUE_TYPE_PROPERTY) { - @Override - protected ElementCollectionMapping2_0.Type buildValue_() { - return this.subject.getValueType(); - } - }; - } - - private Transformer<ElementCollectionMapping2_0.Type, Control> buildPaneTransformer() { - return new Transformer<ElementCollectionMapping2_0.Type, Control>() { - public Control transform(ElementCollectionMapping2_0.Type type) { - return AbstractElementCollectionMapping2_0Composite.this.transformValueType(type); - } - }; - } - - /** - * Given the selected override, return the control that will be displayed - */ - protected Control transformValueType(ElementCollectionMapping2_0.Type type) { - if (type == null) { - return null; - } - switch (type) { - case BASIC_TYPE : - return this.basicValueComposite; - case EMBEDDABLE_TYPE : - return this.embeddableValueComposite; - default : - return null; - } - } - - protected void initializeKeyPane(Composite container) { - - } - - protected PropertyValueModel<CollectionTable2_0> buildCollectionTableHolder() { - return new PropertyAspectAdapter<ElementCollectionMapping2_0, CollectionTable2_0>(getSubjectHolder()) { - @Override - protected CollectionTable2_0 buildValue_() { - return this.subject.getCollectionTable(); - } - }; - } - - protected PropertyValueModel<Column> buildValueColumnHolder() { - return new PropertyAspectAdapter<ElementCollectionMapping2_0, Column>(getSubjectHolder()) { - @Override - protected Column buildValue_() { - return this.subject.getValueColumn(); - } - }; - } - - private WritablePropertyValueModel<Boolean> buildNoConverterHolder() { - return new PropertyAspectAdapter<T, Boolean>(getSubjectHolder(), ConvertibleMapping.CONVERTER_PROPERTY) { - @Override - protected Boolean buildValue_() { - return Boolean.valueOf(this.subject.getConverter().getType() == Converter.NO_CONVERTER); - } - - @Override - protected void setValue_(Boolean value) { - if (value.booleanValue()) { - this.subject.setConverter(Converter.NO_CONVERTER); - } - } - }; - } - - private WritablePropertyValueModel<Boolean> buildLobConverterHolder() { - return new PropertyAspectAdapter<T, Boolean>(getSubjectHolder(), ConvertibleMapping.CONVERTER_PROPERTY) { - @Override - protected Boolean buildValue_() { - Converter converter = this.subject.getConverter(); - return Boolean.valueOf(converter.getType() == Converter.LOB_CONVERTER); - } - - @Override - protected void setValue_(Boolean value) { - if (value.booleanValue()) { - this.subject.setConverter(Converter.LOB_CONVERTER); - } - } - }; - } - - private PropertyValueModel<Converter> buildConverterHolder() { - return new PropertyAspectAdapter<T, Converter>(getSubjectHolder(), ConvertibleMapping.CONVERTER_PROPERTY) { - @Override - protected Converter buildValue_() { - return this.subject.getConverter(); - } - }; - } - - private PropertyValueModel<TemporalConverter> buildTemporalConverterHolder(PropertyValueModel<Converter> converterHolder) { - return new TransformationPropertyValueModel<Converter, TemporalConverter>(converterHolder) { - @Override - protected TemporalConverter transform_(Converter converter) { - return converter.getType() == Converter.TEMPORAL_CONVERTER ? (TemporalConverter) converter : null; - } - }; - } - - private PropertyValueModel<EnumeratedConverter> buildEnumeratedConverterHolder(PropertyValueModel<Converter> converterHolder) { - return new TransformationPropertyValueModel<Converter, EnumeratedConverter>(converterHolder) { - @Override - protected EnumeratedConverter transform_(Converter converter) { - return converter.getType() == Converter.ENUMERATED_CONVERTER ? (EnumeratedConverter) converter : null; - } - }; - } - - private WritablePropertyValueModel<Boolean> buildTemporalBooleanHolder() { - return new PropertyAspectAdapter<T, Boolean>(getSubjectHolder(), ConvertibleMapping.CONVERTER_PROPERTY) { - @Override - protected Boolean buildValue_() { - Converter converter = this.subject.getConverter(); - return Boolean.valueOf(converter.getType() == Converter.TEMPORAL_CONVERTER); - } - - @Override - protected void setValue_(Boolean value) { - if (value.booleanValue()) { - this.subject.setConverter(Converter.TEMPORAL_CONVERTER); - } - } - }; - } - - private WritablePropertyValueModel<Boolean> buildEnumeratedBooleanHolder() { - return new PropertyAspectAdapter<T, Boolean>(getSubjectHolder(), ConvertibleMapping.CONVERTER_PROPERTY) { - @Override - protected Boolean buildValue_() { - Converter converter = this.subject.getConverter(); - return Boolean.valueOf(converter.getType() == Converter.ENUMERATED_CONVERTER); - } - - @Override - protected void setValue_(Boolean value) { - if (value.booleanValue()) { - this.subject.setConverter(Converter.ENUMERATED_CONVERTER); - } - } - }; - } - protected Composite addPane(Composite container, int groupBoxMargin) { - return addSubPane(container, 0, groupBoxMargin, 0, groupBoxMargin); - } - -}
\ No newline at end of file diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/AbstractElementCollectionMapping2_0UiDefinition.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/AbstractElementCollectionMapping2_0UiDefinition.java deleted file mode 100644 index 0dd4f66dad..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/AbstractElementCollectionMapping2_0UiDefinition.java +++ /dev/null @@ -1,43 +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.ui.internal.jpa2.details; - -import org.eclipse.jpt.core.jpa2.MappingKeys2_0; -import org.eclipse.jpt.core.jpa2.context.ElementCollectionMapping2_0; -import org.eclipse.jpt.ui.details.MappingUiDefinition; -import org.eclipse.jpt.ui.internal.JpaMappingImageHelper; -import org.eclipse.swt.graphics.Image; - -public abstract class AbstractElementCollectionMapping2_0UiDefinition<T extends ElementCollectionMapping2_0> - implements MappingUiDefinition<T> -{ - - protected AbstractElementCollectionMapping2_0UiDefinition() { - super(); - } - - - public Image getImage() { - return JpaMappingImageHelper.imageForAttributeMapping(getKey()); - } - - public String getLabel() { - return JptUiDetailsMessages2_0.ElementCollectionMapping2_0_label; - } - - public String getLinkLabel() { - return JptUiDetailsMessages2_0.ElementCollectionMapping2_0_linkLabel; - } - - public String getKey() { - return MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY; - } -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/AbstractManyToOneMapping2_0Composite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/AbstractManyToOneMapping2_0Composite.java deleted file mode 100644 index 4e7582a5ad..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/AbstractManyToOneMapping2_0Composite.java +++ /dev/null @@ -1,41 +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.ui.internal.jpa2.details; - -import org.eclipse.jpt.core.jpa2.context.DerivedIdentity2_0; -import org.eclipse.jpt.core.jpa2.context.ManyToOneMapping2_0; -import org.eclipse.jpt.ui.WidgetFactory; -import org.eclipse.jpt.ui.internal.details.AbstractManyToOneMappingComposite; -import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter; -import org.eclipse.jpt.utility.model.value.PropertyValueModel; -import org.eclipse.swt.widgets.Composite; - -public abstract class AbstractManyToOneMapping2_0Composite<T extends ManyToOneMapping2_0> - extends AbstractManyToOneMappingComposite<T> -{ - protected AbstractManyToOneMapping2_0Composite( - PropertyValueModel<? extends T> subjectHolder, - Composite parent, - WidgetFactory widgetFactory) { - - super(subjectHolder, parent, widgetFactory); - } - - - protected PropertyValueModel<DerivedIdentity2_0> buildDerivedIdentityHolder() { - return new PropertyAspectAdapter<T, DerivedIdentity2_0>(getSubjectHolder()) { - @Override - protected DerivedIdentity2_0 buildValue_() { - return this.subject.getDerivedIdentity(); - } - }; - } -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/AbstractOneToOneMapping2_0Composite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/AbstractOneToOneMapping2_0Composite.java deleted file mode 100644 index 5d11d24a73..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/AbstractOneToOneMapping2_0Composite.java +++ /dev/null @@ -1,41 +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.ui.internal.jpa2.details; - -import org.eclipse.jpt.core.jpa2.context.DerivedIdentity2_0; -import org.eclipse.jpt.core.jpa2.context.OneToOneMapping2_0; -import org.eclipse.jpt.ui.WidgetFactory; -import org.eclipse.jpt.ui.internal.details.AbstractOneToOneMappingComposite; -import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter; -import org.eclipse.jpt.utility.model.value.PropertyValueModel; -import org.eclipse.swt.widgets.Composite; - -public abstract class AbstractOneToOneMapping2_0Composite<T extends OneToOneMapping2_0> - extends AbstractOneToOneMappingComposite<T> -{ - protected AbstractOneToOneMapping2_0Composite( - PropertyValueModel<? extends T> subjectHolder, - Composite parent, - WidgetFactory widgetFactory) { - - super(subjectHolder, parent, widgetFactory); - } - - - protected PropertyValueModel<DerivedIdentity2_0> buildDerivedIdentityHolder() { - return new PropertyAspectAdapter<T, DerivedIdentity2_0>(getSubjectHolder()) { - @Override - protected DerivedIdentity2_0 buildValue_() { - return this.subject.getDerivedIdentity(); - } - }; - } -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/AssociationOverride2_0Composite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/AssociationOverride2_0Composite.java deleted file mode 100644 index 7c7b09b4ff..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/AssociationOverride2_0Composite.java +++ /dev/null @@ -1,88 +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.ui.internal.jpa2.details; - -import org.eclipse.jpt.core.context.AssociationOverride; -import org.eclipse.jpt.core.jpa2.context.AssociationOverrideRelationshipReference2_0; -import org.eclipse.jpt.ui.internal.details.AssociationOverrideComposite; -import org.eclipse.jpt.ui.internal.details.JoinTableJoiningStrategyPane; -import org.eclipse.jpt.ui.internal.details.JptUiDetailsMessages; -import org.eclipse.jpt.ui.internal.widgets.Pane; -import org.eclipse.jpt.utility.internal.model.value.TransformationPropertyValueModel; -import org.eclipse.jpt.utility.model.value.PropertyValueModel; -import org.eclipse.swt.widgets.Composite; - -/** - * Here the layout of this pane: - * <pre> - * ----------------------------------------------------------------------------- - * | | - * | JoinColumnJoiningStrategyPane | - * | JoinTableJoiningStrategyPane | - * | | - * -----------------------------------------------------------------------------</pre> - * - * @see AssociationOverride - * @see EntityOverridesComposite - The parent container - * @see JoinColumnsComposite - * - * @version 2.3 - * @since 1.0 - */ -public class AssociationOverride2_0Composite - extends AssociationOverrideComposite -{ - /** - * Creates a new <code>AssociationOverrideComposite</code>. - * - * @param subjectHolder The holder of the subject <code>AssociationOverride</code> - * @param parent The parent container - * @param widgetFactory The factory used to create various common widgets - */ - public AssociationOverride2_0Composite(Pane<?> parentPane, - PropertyValueModel<? extends AssociationOverride> subjectHolder, - Composite parent) { - - super(parentPane, subjectHolder, parent); - } - - - @Override - protected void initializeLayout(Composite container) { - Composite composite = addTitledGroup( - container, - JptUiDetailsMessages.Joining_title); - - addJoinColumnJoiningStrategyPane(composite); - - addJoinTableJoiningStrategyPane(composite); - - addSubPane(composite, 5); - } - - protected void addJoinTableJoiningStrategyPane(Composite container) { - new JoinTableJoiningStrategyPane(this, buildRelationshipReferenceHolder(), container); - } - - private PropertyValueModel<AssociationOverrideRelationshipReference2_0> buildRelationshipReferenceHolder() { - return new TransformationPropertyValueModel<AssociationOverride, AssociationOverrideRelationshipReference2_0>(getSubjectHolder()) { - @Override - protected AssociationOverrideRelationshipReference2_0 transform_(AssociationOverride value) { - return (AssociationOverrideRelationshipReference2_0) value.getRelationshipReference(); - } - }; - } - - @Override - public void enableWidgets(boolean enabled) { - super.enableWidgets(enabled); -// this.joinColumnsComposite.enableWidgets(enabled); - } -}
\ No newline at end of file diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/Cacheable2_0Pane.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/Cacheable2_0Pane.java deleted file mode 100644 index 3332721874..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/Cacheable2_0Pane.java +++ /dev/null @@ -1,107 +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.ui.internal.jpa2.details; - -import org.eclipse.jpt.core.jpa2.context.Cacheable2_0; -import org.eclipse.jpt.ui.internal.JpaHelpContextIds; -import org.eclipse.jpt.ui.internal.details.JptUiDetailsMessages; -import org.eclipse.jpt.ui.internal.widgets.Pane; -import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter; -import org.eclipse.jpt.utility.internal.model.value.TransformationPropertyValueModel; -import org.eclipse.jpt.utility.model.value.PropertyValueModel; -import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel; -import org.eclipse.osgi.util.NLS; -import org.eclipse.swt.widgets.Composite; - -/** - * Here the layout of this pane: - * <pre> - * ----------------------------------------------------------------------------- - * | [X] Cacheable (true/false) - * -----------------------------------------------------------------------------</pre> - * - * @see Cacheable2_0 - * @see JavaEntity2_0Composite - A container of this widget - * @see OrmEntity2_0Composite - A container of this widget - */ -public class Cacheable2_0Pane - extends Pane<Cacheable2_0> -{ - public Cacheable2_0Pane( - Pane<?> parentPane, - PropertyValueModel<? extends Cacheable2_0> subjectHolder, - Composite parent) { - - super(parentPane, subjectHolder, parent); - } - - - @Override - protected void initializeLayout(Composite container) { - addTriStateCheckBoxWithDefault( - container, - JptUiDetailsMessages2_0.Entity_cacheableLabel, - buildCacheableBooleanHolder(), - buildCacheableStringHolder(), - JpaHelpContextIds.ENTITY_CACHEABLE - ); - } - - - private WritablePropertyValueModel<Boolean> buildCacheableBooleanHolder() { - return new PropertyAspectAdapter<Cacheable2_0, Boolean>( - getSubjectHolder(), - Cacheable2_0.DEFAULT_CACHEABLE_PROPERTY, - Cacheable2_0.SPECIFIED_CACHEABLE_PROPERTY) - { - @Override - protected Boolean buildValue_() { - return this.subject.getSpecifiedCacheable(); - } - - @Override - protected void setValue_(Boolean value) { - this.subject.setSpecifiedCacheable(value); - } - }; - } - - private PropertyValueModel<String> buildCacheableStringHolder() { - - return new TransformationPropertyValueModel<Boolean, String>(buildDefaultCacheableHolder()) { - - @Override - protected String transform(Boolean value) { - if (value != null) { - String defaultStringValue = value.booleanValue() ? JptUiDetailsMessages.Boolean_True : JptUiDetailsMessages.Boolean_False; - return NLS.bind(JptUiDetailsMessages2_0.Entity_cacheableWithDefaultLabel, defaultStringValue); - } - return JptUiDetailsMessages2_0.Entity_cacheableLabel; - } - }; - } - - private PropertyValueModel<Boolean> buildDefaultCacheableHolder() { - return new PropertyAspectAdapter<Cacheable2_0, Boolean>( - getSubjectHolder(), - Cacheable2_0.SPECIFIED_CACHEABLE_PROPERTY, - Cacheable2_0.DEFAULT_CACHEABLE_PROPERTY) - { - @Override - protected Boolean buildValue_() { - if (this.subject.getSpecifiedCacheable() != null) { - return null; - } - return Boolean.valueOf(this.subject.isDefaultCacheable()); - } - }; - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/CollectionTable2_0Composite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/CollectionTable2_0Composite.java deleted file mode 100644 index f76db546de..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/CollectionTable2_0Composite.java +++ /dev/null @@ -1,155 +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.ui.internal.jpa2.details; - -import org.eclipse.jpt.core.jpa2.context.CollectionTable2_0; -import org.eclipse.jpt.ui.WidgetFactory; -import org.eclipse.jpt.ui.internal.JpaHelpContextIds; -import org.eclipse.jpt.ui.internal.details.JoinColumnsComposite; -import org.eclipse.jpt.ui.internal.details.ReferenceTableComposite; -import org.eclipse.jpt.ui.internal.details.db.CatalogCombo; -import org.eclipse.jpt.ui.internal.details.db.SchemaCombo; -import org.eclipse.jpt.ui.internal.details.db.TableCombo; -import org.eclipse.jpt.ui.internal.widgets.Pane; -import org.eclipse.jpt.utility.model.value.PropertyValueModel; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Group; - -/** - * The layout of this pane: - * <pre> - * ----------------------------------------------------------------------------- - * | ------------------------------------------------------------ | - * | Name: | |v| | - * | ------------------------------------------------------------ | - * | ------------------------------------------------------------ | - * | Schema: | |v| | - * | ------------------------------------------------------------ | - * | ------------------------------------------------------------ | - * | Catalog: | |v| | - * | ------------------------------------------------------------ | - * | | - * | - Join Columns ---------------------------------------------------------- | - * | | | | - * | | x Override Default | | - * | | | | - * | | --------------------------------------------------------------------- | | - * | | | | | | - * | | | JoinColumnsComposite | | | - * | | | | | | - * | | --------------------------------------------------------------------- | | - * | ------------------------------------------------------------------------- | - * -----------------------------------------------------------------------------</pre> - * - * @see {@link CollectionTable2_0} - * @see {@link JoinColumnsComposite - * - * @version 3.0 - * @since 3.0 - */ -public class CollectionTable2_0Composite extends ReferenceTableComposite<CollectionTable2_0> -{ - /** - * Creates a new <code>CollectionTable2_0Composite</code>. - * - * @param parentPane The parent container of this one - * @param subjectHolder The holder of this pane's subject - * @param parent The parent container - */ - public CollectionTable2_0Composite( - Pane<?> parentPane, - PropertyValueModel<? extends CollectionTable2_0> subjectHolder, - Composite parent) { - - super(parentPane, subjectHolder, parent); - } - - /** - * Creates a new <code>CollectionTable2_0Composite</code>. - * - * @param subjectHolder The holder of the subject <code>CollectionTable2_0</code> - * @param parent The parent container - * @param widgetFactory The factory used to create various common widgets - */ - public CollectionTable2_0Composite(PropertyValueModel<? extends CollectionTable2_0> subjectHolder, - Composite parent, - WidgetFactory widgetFactory) { - - super(subjectHolder, parent, widgetFactory); - } - - @Override - protected void initializeLayout(Composite container) { - // collection table group pane - container = addTitledGroup( - container, - JptUiDetailsMessages2_0.CollectionTable2_0Composite_title - ); - - int groupBoxMargin = getGroupBoxMargin(); - - // Name widgets - TableCombo<CollectionTable2_0> tableCombo = addTableCombo(container); - Composite tablePane = addPane(container, groupBoxMargin); - addLabeledComposite( - tablePane, - JptUiDetailsMessages2_0.CollectionTable2_0Composite_name, - tableCombo.getControl(), - JpaHelpContextIds.MAPPING_COLLECTION_TABLE_NAME - ); - - // schema widgets - SchemaCombo<CollectionTable2_0> schemaCombo = addSchemaCombo(container); - - addLabeledComposite( - tablePane, - JptUiDetailsMessages2_0.CollectionTable2_0Composite_schema, - schemaCombo.getControl(), - JpaHelpContextIds.MAPPING_COLLECTION_TABLE_SCHEMA - ); - - // catalog widgets - CatalogCombo<CollectionTable2_0> catalogCombo = addCatalogCombo(container); - - addLabeledComposite( - tablePane, - JptUiDetailsMessages2_0.CollectionTable2_0Composite_catalog, - catalogCombo.getControl(), - JpaHelpContextIds.MAPPING_COLLECTION_TABLE_CATALOG - ); - - // Join Columns group pane - Group joinColumnGroupPane = addTitledGroup( - container, - JptUiDetailsMessages2_0.CollectionTable2_0Composite_joinColumn - ); - - // Override Default Join Columns check box - this.overrideDefaultJoinColumnsCheckBox = addCheckBox( - addSubPane(joinColumnGroupPane, 8), - JptUiDetailsMessages2_0.CollectionTable2_0Composite_overrideDefaultJoinColumns, - buildOverrideDefaultJoinColumnHolder(), - null - ); - - this.joinColumnsComposite = new JoinColumnsComposite<CollectionTable2_0>( - this, - joinColumnGroupPane, - buildJoinColumnsEditor() - ); - - installJoinColumnsPaneEnabler(this.joinColumnsComposite); - } - - @Override - protected boolean isParentVirtual(CollectionTable2_0 collectionTable) { - return collectionTable.getPersistentAttribute().isVirtual(); - } -}
\ No newline at end of file diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/DerivedIdentity2_0Pane.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/DerivedIdentity2_0Pane.java deleted file mode 100644 index a67504b99b..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/DerivedIdentity2_0Pane.java +++ /dev/null @@ -1,217 +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.ui.internal.jpa2.details; - -import java.util.Collection; - -import org.eclipse.jpt.core.jpa2.context.DerivedIdentity2_0; -import org.eclipse.jpt.core.jpa2.context.MapsIdDerivedIdentityStrategy2_0; -import org.eclipse.jpt.ui.internal.utility.swt.SWTTools; -import org.eclipse.jpt.ui.internal.widgets.ComboPane; -import org.eclipse.jpt.ui.internal.widgets.Pane; -import org.eclipse.jpt.utility.internal.iterables.EmptyIterable; -import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter; -import org.eclipse.jpt.utility.model.value.PropertyValueModel; -import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Composite; - -public class DerivedIdentity2_0Pane - extends Pane<DerivedIdentity2_0> -{ - public DerivedIdentity2_0Pane( - Pane<?> parentPane, - PropertyValueModel<? extends DerivedIdentity2_0> subjectHolder, - Composite parent) { - - super(parentPane, subjectHolder, parent); - } - - - @Override - protected void initializeLayout(Composite container) { - Composite composite = addCollapsibleSection( - container, - JptUiDetailsMessages2_0.DerivedIdentity_title); - - addNullDerivedIdentityPane(composite); - addIdDerivedIdentityPane(composite); - addMapsIdDerivedIdentityPane(composite); - addSubPane(container, 5); - } - - protected void addNullDerivedIdentityPane(Composite parent) { - addRadioButton( - parent, - JptUiDetailsMessages2_0.DerivedIdentity_nullDerivedIdentity, - buildUsesNullDerivedIdentityStrategyHolder(), - null); - } - - protected WritablePropertyValueModel<Boolean> buildUsesNullDerivedIdentityStrategyHolder() { - return new PropertyAspectAdapter<DerivedIdentity2_0, Boolean>( - getSubjectHolder(), DerivedIdentity2_0.PREDOMINANT_DERIVED_IDENTITY_STRATEGY_PROPERTY) { - - @Override - protected Boolean buildValue_() { - return this.subject.usesNullDerivedIdentityStrategy(); - } - - @Override - protected void setValue_(Boolean value) { - // radio button - should only have true values here - if (value) { - this.subject.setNullDerivedIdentityStrategy(); - } - } - }; - } - - protected void addIdDerivedIdentityPane(Composite parent) { - addRadioButton( - parent, - JptUiDetailsMessages2_0.DerivedIdentity_idDerivedIdentity, - buildUsesIdDerivedIdentityStrategyHolder(), - null); - } - - protected WritablePropertyValueModel<Boolean> buildUsesIdDerivedIdentityStrategyHolder() { - return new PropertyAspectAdapter<DerivedIdentity2_0, Boolean>( - getSubjectHolder(), DerivedIdentity2_0.PREDOMINANT_DERIVED_IDENTITY_STRATEGY_PROPERTY) { - - @Override - protected Boolean buildValue_() { - return this.subject.usesIdDerivedIdentityStrategy(); - } - - @Override - protected void setValue_(Boolean value) { - // radio button - should only have true values here - if (value) { - this.subject.setIdDerivedIdentityStrategy(); - } - } - }; - } - - protected void addMapsIdDerivedIdentityPane(Composite parent) { - addPaneForAlignment(buildMapsIdValueComboPane(parent)); - } - - protected ComboPane buildMapsIdValueComboPane(Composite parent) { - return new MapsIdValueComboPane(this, buildMapsIdStrategyHolder(), parent); - } - - protected PropertyValueModel<MapsIdDerivedIdentityStrategy2_0> buildMapsIdStrategyHolder() { - return new PropertyAspectAdapter<DerivedIdentity2_0, MapsIdDerivedIdentityStrategy2_0>(getSubjectHolder()) { - @Override - protected MapsIdDerivedIdentityStrategy2_0 buildValue_() { - return this.subject.getMapsIdDerivedIdentityStrategy(); - } - }; - } - - - private class MapsIdValueComboPane - extends ComboPane<MapsIdDerivedIdentityStrategy2_0> - { - public MapsIdValueComboPane( - Pane<?> parentPane, - PropertyValueModel<? extends MapsIdDerivedIdentityStrategy2_0> subjectHolder, - Composite parent) { - - super(parentPane, subjectHolder, parent); - } - - - @Override - protected void initializeLayout(Composite container) { - container = addContainer(container); - ((GridLayout) container.getLayout()).numColumns = 2; - - WritablePropertyValueModel<Boolean> usesMapsIdHolder = - buildUsesMapsIdDerivedIdentityStrategyHolder(); - - addRadioButton( - container, - JptUiDetailsMessages2_0.DerivedIdentity_mapsIdDerivedIdentity, - usesMapsIdHolder, - null); - - super.initializeLayout(container); - - this.comboBox.setEnabled(false); - SWTTools.controlEnabledState(usesMapsIdHolder, this.comboBox); - } - - protected WritablePropertyValueModel<Boolean> buildUsesMapsIdDerivedIdentityStrategyHolder() { - return new PropertyAspectAdapter<DerivedIdentity2_0, Boolean>( - buildDerivedIdentityHolder(), DerivedIdentity2_0.PREDOMINANT_DERIVED_IDENTITY_STRATEGY_PROPERTY) { - - @Override - protected Boolean buildValue_() { - return this.subject.usesMapsIdDerivedIdentityStrategy(); - } - - @Override - protected void setValue_(Boolean value) { - // radio button - should only have true values here - if (value) { - this.subject.setMapsIdDerivedIdentityStrategy(); - } - } - }; - } - - protected PropertyValueModel<DerivedIdentity2_0> buildDerivedIdentityHolder() { - return new PropertyAspectAdapter<MapsIdDerivedIdentityStrategy2_0, DerivedIdentity2_0>(getSubjectHolder()) { - @Override - protected DerivedIdentity2_0 buildValue_() { - return this.subject.getDerivedIdentity(); - } - }; - } - - @Override - protected void addPropertyNames(Collection<String> propertyNames) { - super.addPropertyNames(propertyNames); - propertyNames.add(MapsIdDerivedIdentityStrategy2_0.DEFAULT_VALUE_PROPERTY); - propertyNames.add(MapsIdDerivedIdentityStrategy2_0.SPECIFIED_VALUE_PROPERTY); - } - - @Override - protected String getValue() { - return (getSubject() == null) ? null : getSubject().getSpecifiedValue(); - } - - @Override - protected void setValue(String value) { - if (getSubject() != null) getSubject().setSpecifiedValue(value); - } - - @Override - protected String getDefaultValue() { - return (getSubject() == null) ? null : getSubject().getDefaultValue(); - } - - @Override - protected Iterable<String> getValues() { - return (getSubject() == null) ? EmptyIterable.<String>instance() : getSubject().getSortedValueChoices(); - } - - @Override - protected String buildNullDefaultValueEntry() { - boolean useNullString = (getSubject() == null) ? false : getSubject().usesDefaultValue(); - return (useNullString) ? - buildNonNullDefaultValueEntry(JptUiDetailsMessages2_0.DerivedIdentity_mapsIdUnspecifiedValue) - : ""; - } - } -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/ElementCollectionMapping2_0Composite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/ElementCollectionMapping2_0Composite.java deleted file mode 100644 index 9d00a0c650..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/ElementCollectionMapping2_0Composite.java +++ /dev/null @@ -1,81 +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.ui.internal.jpa2.details; - -import org.eclipse.jpt.core.context.BasicMapping; -import org.eclipse.jpt.core.jpa2.context.ElementCollectionMapping2_0; -import org.eclipse.jpt.ui.WidgetFactory; -import org.eclipse.jpt.utility.model.value.PropertyValueModel; -import org.eclipse.swt.widgets.Composite; - -/** - * Here the layout of this pane: - * <pre> - * ----------------------------------------------------------------------------- - * | ------------------------------------------------------------------------- | - * | | | | - * | | TargetClassComposite | | - * | | | | - * | ------------------------------------------------------------------------- | - * | ------------------------------------------------------------------------- | - * | | | | - * | | FetchTypeComposite | | - * | | | | - * | ------------------------------------------------------------------------- | - * | ------------------------------------------------------------------------- | - * | | | | - * | | CollectionTableComposite | | - * | | | | - * | ------------------------------------------------------------------------- | - * | ------------------------------------------------------------------------- | - * | | | | - * | | ColumnComposite | | - * | | | | - * | ------------------------------------------------------------------------- | - * | ------------------------------------------------------------------------- | - * | | | | - * | | OptionalComposite | | - * | | | | - * | ------------------------------------------------------------------------- | - * | ------------------------------------------------------------------------- | - * | | | | - * | | LobComposite | | - * | | | | - * | ------------------------------------------------------------------------- | - * -----------------------------------------------------------------------------</pre> - * - * @see BasicMapping - * @see OrderColumnComposite - * @see EnumTypeComposite - * @see FetchTypeComposite - * @see LobComposite - * @see OptionalComposite - * @see TemporalTypeComposite - * - * @version 3.0 - * @since 3.0 - */ -public class ElementCollectionMapping2_0Composite extends AbstractElementCollectionMapping2_0Composite<ElementCollectionMapping2_0> -{ - /** - * Creates a new <code>BasicMappingComposite</code>. - * - * @param subjectHolder The holder of the subject <code>IBasicMapping</code> - * @param parent The parent container - * @param widgetFactory The factory used to create various common widgets - */ - public ElementCollectionMapping2_0Composite(PropertyValueModel<? extends ElementCollectionMapping2_0> subjectHolder, - Composite parent, - WidgetFactory widgetFactory) { - - super(subjectHolder, parent, widgetFactory); - } - -}
\ No newline at end of file diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/ElementCollectionValueOverridesComposite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/ElementCollectionValueOverridesComposite.java deleted file mode 100644 index 9230cc9596..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/ElementCollectionValueOverridesComposite.java +++ /dev/null @@ -1,99 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.ui.internal.jpa2.details; - -import org.eclipse.jpt.core.context.AssociationOverride; -import org.eclipse.jpt.core.context.AssociationOverrideContainer; -import org.eclipse.jpt.core.context.AttributeOverrideContainer; -import org.eclipse.jpt.core.jpa2.context.ElementCollectionMapping2_0; -import org.eclipse.jpt.ui.internal.details.AbstractOverridesComposite; -import org.eclipse.jpt.ui.internal.details.AssociationOverrideComposite; -import org.eclipse.jpt.ui.internal.widgets.Pane; -import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter; -import org.eclipse.jpt.utility.model.value.PropertyValueModel; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.ui.part.PageBook; - -/** - * Here is the layout of this pane: - * <pre> - * -------------------------------------------------------------------------------- - * | | - * | - Attribute Overrides ------------------------------------------------------ | - * | | ------------------------------------------------------------------------ | | - * | | | | | | - * | | | AddRemoveListPane | | | - * | | | | | | - * | | ------------------------------------------------------------------------ | | - * | | | | - * | | x Override Default | | - * | | | | - * | | ------------------------------------------------------------------------ | | - * | | | | | | - * | | | PageBook (AttributeOverrideComposite/AssociationOverride2_0Composite)| | | - * | | | | | | - * | | ------------------------------------------------------------------------ | | - * | ---------------------------------------------------------------------------- | - * --------------------------------------------------------------------------------</pre> - * - * @see ElementCollectionMapping2_0 - * @see AbstractElementCollectionMapping2_0Composite - The parent container - * @see AttributeOverrideComposite - * @see AssociationOverride2_0Composite - * - * @version 3.0 - * @since 3.0 - */ -public final class ElementCollectionValueOverridesComposite extends AbstractOverridesComposite<ElementCollectionMapping2_0> -{ - - /** - * Creates a new <code>OverridesComposite</code>. - * - * @param parentPane The parent controller of this one - * @param parent The parent container - */ - public ElementCollectionValueOverridesComposite(Pane<? extends ElementCollectionMapping2_0> parentPane, - Composite parent) { - - super(parentPane, parent); - } - - @Override - protected boolean supportsAssociationOverrides() { - return true; - } - - @Override - protected Pane<AssociationOverride> buildAssociationOverridePane(PageBook pageBook, PropertyValueModel<AssociationOverride> associationOverrideHolder) { - return new AssociationOverrideComposite(this, associationOverrideHolder, pageBook); - } - - @Override - protected PropertyValueModel<AttributeOverrideContainer> buildAttributeOverrideContainerHolder() { - return new PropertyAspectAdapter<ElementCollectionMapping2_0, AttributeOverrideContainer>(getSubjectHolder()) { - @Override - protected AttributeOverrideContainer buildValue_() { - return this.subject.getValueAttributeOverrideContainer(); - } - }; - } - - @Override - protected PropertyValueModel<AssociationOverrideContainer> buildAssociationOverrideContainerHolder() { - return new PropertyAspectAdapter<ElementCollectionMapping2_0, AssociationOverrideContainer>(getSubjectHolder()) { - @Override - protected AssociationOverrideContainer buildValue_() { - return this.subject.getValueAssociationOverrideContainer(); - } - }; - } - -}
\ No newline at end of file diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/EmbeddedMapping2_0OverridesComposite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/EmbeddedMapping2_0OverridesComposite.java deleted file mode 100644 index efe027a4c8..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/EmbeddedMapping2_0OverridesComposite.java +++ /dev/null @@ -1,94 +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.ui.internal.jpa2.details; - -import org.eclipse.jpt.core.context.AssociationOverride; -import org.eclipse.jpt.core.context.AssociationOverrideContainer; -import org.eclipse.jpt.core.context.AttributeOverrideContainer; -import org.eclipse.jpt.core.context.EmbeddedMapping; -import org.eclipse.jpt.core.jpa2.context.EmbeddedMapping2_0; -import org.eclipse.jpt.ui.internal.details.AbstractEmbeddedMappingOverridesComposite; -import org.eclipse.jpt.ui.internal.widgets.Pane; -import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter; -import org.eclipse.jpt.utility.model.value.PropertyValueModel; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.ui.part.PageBook; - -/** - * Here the layout of this pane: - * <pre> - * ----------------------------------------------------------------------------- - * | ------------------------------------------------------------------------- | - * | | | | - * | | AddRemoveListPane | | - * | | | | - * | ------------------------------------------------------------------------- | - * | | - * | x Override Default | - * | | - * | ------------------------------------------------------------------------- | - * | | | | - * | | ColumnComposite | | - * | | | | - * | ------------------------------------------------------------------------- | - * -----------------------------------------------------------------------------</pre> - * - * @see EmbeddedMapping - * @see ColumnComposite - * - * @version 3.0 - * @since 3.0 - */ -public class EmbeddedMapping2_0OverridesComposite extends AbstractEmbeddedMappingOverridesComposite<EmbeddedMapping> -{ - - /** - * Creates a new <code>EmbeddedAttributeOverridesComposite</code>. - * - * @param parentPane The parent container of this one - * @param parent The parent container - */ - public EmbeddedMapping2_0OverridesComposite(Pane<? extends EmbeddedMapping> parentPane, - Composite parent) { - - super(parentPane, parent); - } - - @Override - protected boolean supportsAssociationOverrides() { - return true; - } - - @Override - protected PropertyValueModel<AttributeOverrideContainer> buildAttributeOverrideContainerHolder() { - return new PropertyAspectAdapter<EmbeddedMapping, AttributeOverrideContainer>(getSubjectHolder()) { - @Override - protected AttributeOverrideContainer buildValue_() { - return this.subject.getAttributeOverrideContainer(); - } - }; - } - - @Override - protected Pane<AssociationOverride> buildAssociationOverridePane(PageBook pageBook, PropertyValueModel<AssociationOverride> associationOverrideHolder) { - return new AssociationOverride2_0Composite(this, associationOverrideHolder, pageBook); - } - - @Override - protected PropertyValueModel<AssociationOverrideContainer> buildAssociationOverrideContainerHolder() { - return new PropertyAspectAdapter<EmbeddedMapping, AssociationOverrideContainer>(getSubjectHolder()) { - @Override - protected AssociationOverrideContainer buildValue_() { - return ((EmbeddedMapping2_0) this.subject).getAssociationOverrideContainer(); - } - }; - } - -}
\ No newline at end of file diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/Entity2_0OverridesComposite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/Entity2_0OverridesComposite.java deleted file mode 100644 index 104750cef7..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/Entity2_0OverridesComposite.java +++ /dev/null @@ -1,70 +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.ui.internal.jpa2.details; - -import org.eclipse.jpt.core.context.AssociationOverride; -import org.eclipse.jpt.core.context.Entity; -import org.eclipse.jpt.ui.internal.details.AbstractEntityOverridesComposite; -import org.eclipse.jpt.ui.internal.widgets.Pane; -import org.eclipse.jpt.utility.model.value.PropertyValueModel; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.ui.part.PageBook; - -/** - * Here the layout of this pane: - * <pre> - * ----------------------------------------------------------------------------- - * | | - * | - Attribute Overrides --------------------------------------------------- | - * | | --------------------------------------------------------------------- | | - * | | | | | | - * | | | AddRemoveListPane | | | - * | | | | | | - * | | --------------------------------------------------------------------- | | - * | | | | - * | | x Override Default | | - * | | | | - * | | --------------------------------------------------------------------- | | - * | | | | | | - * | | | PageBook (AttributeOverrideComposite/AssociationOverrideComposite)| | | - * | | | | | | - * | | --------------------------------------------------------------------- | | - * | ------------------------------------------------------------------------- | - * -----------------------------------------------------------------------------</pre> - * - * @see Entity - * @see Entity2_0Composite - The parent container - * @see AttributeOverrideComposite - * @see AssociationOverride2_0Composite - * - * @version 3.0 - * @since 2.2 - */ -public class Entity2_0OverridesComposite extends AbstractEntityOverridesComposite -{ - - /** - * Creates a new <code>OverridesComposite</code>. - * - * @param parentPane The parent controller of this one - * @param parent The parent container - */ - public Entity2_0OverridesComposite(Pane<? extends Entity> parentPane, - Composite parent) { - - super(parentPane, parent); - } - - @Override - protected Pane<AssociationOverride> buildAssociationOverridePane(PageBook pageBook, PropertyValueModel<AssociationOverride> associationOverrideHolder) { - return new AssociationOverride2_0Composite(this, associationOverrideHolder, pageBook); - } - -}
\ No newline at end of file diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/Generation2_0Composite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/Generation2_0Composite.java deleted file mode 100644 index 442e1baa18..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/Generation2_0Composite.java +++ /dev/null @@ -1,42 +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.ui.internal.jpa2.details; - -import org.eclipse.jpt.core.context.GeneratorContainer; -import org.eclipse.jpt.ui.internal.details.GenerationComposite; -import org.eclipse.jpt.ui.internal.widgets.Pane; -import org.eclipse.jpt.utility.model.value.PropertyValueModel; -import org.eclipse.swt.widgets.Composite; - -/** - * Generation2_0Composite - */ -public class Generation2_0Composite extends GenerationComposite -{ - - public Generation2_0Composite( - Pane<?> parentPane, - PropertyValueModel<? extends GeneratorContainer> subjectHolder, - Composite parent) { - - super(parentPane, subjectHolder, parent); - } - - @Override - protected void addSequenceGeneratorComposite(Composite container, int topMargin, int leftMargin) { - new SequenceGenerator2_0Composite( - this, - this.buildSequenceGeneratorHolder(), - this.addSubPane(container, topMargin, leftMargin), - this.buildSequenceGeneratorBuilder() - ); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/IdMappingGeneration2_0Composite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/IdMappingGeneration2_0Composite.java deleted file mode 100644 index 381ae4acb9..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/IdMappingGeneration2_0Composite.java +++ /dev/null @@ -1,48 +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.ui.internal.jpa2.details; - -import org.eclipse.jpt.core.context.IdMapping; -import org.eclipse.jpt.core.context.SequenceGenerator; -import org.eclipse.jpt.ui.internal.details.IdMappingGenerationComposite; -import org.eclipse.jpt.ui.internal.details.SequenceGeneratorComposite; -import org.eclipse.jpt.ui.internal.details.GeneratorComposite.GeneratorBuilder; -import org.eclipse.jpt.ui.internal.widgets.Pane; -import org.eclipse.jpt.utility.model.value.PropertyValueModel; -import org.eclipse.swt.widgets.Composite; - -/** - * IdMappingGeneration2_0Composite - */ -public class IdMappingGeneration2_0Composite extends IdMappingGenerationComposite -{ - - public IdMappingGeneration2_0Composite(Pane<? extends IdMapping> parentPane, Composite parent) { - super(parentPane, parent); - } - - @Override - protected SequenceGeneratorComposite buildSequenceGeneratorComposite( - Composite container, - PropertyValueModel<SequenceGenerator> sequenceGeneratorHolder, - GeneratorBuilder<SequenceGenerator> sequenceGeneratorBuilder, - int topMargin, - int leftMargin) { - - return new SequenceGenerator2_0Composite( - this, - sequenceGeneratorHolder, - this.addSubPane(container, topMargin, leftMargin), - sequenceGeneratorBuilder - ); - } - - -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/JptUiDetailsMessages2_0.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/JptUiDetailsMessages2_0.java deleted file mode 100644 index 2227252428..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/JptUiDetailsMessages2_0.java +++ /dev/null @@ -1,71 +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.ui.internal.jpa2.details; - -import org.eclipse.osgi.util.NLS; - -/** - * Localized messages used by Dali mapping panes. - * - * @version 3.0 - * @since 3.0 - */ -public class JptUiDetailsMessages2_0 -{ - public static String CollectionTable2_0Composite_title; - public static String CollectionTable2_0Composite_joinColumn; - public static String CollectionTable2_0Composite_name; - public static String CollectionTable2_0Composite_schema; - public static String CollectionTable2_0Composite_catalog; - public static String CollectionTable2_0Composite_overrideDefaultJoinColumns; - - public static String DerivedIdentity_title; - public static String DerivedIdentity_nullDerivedIdentity; - public static String DerivedIdentity_idDerivedIdentity; - public static String DerivedIdentity_mapsIdDerivedIdentity; - public static String DerivedIdentity_mapsIdUnspecifiedValue; - - public static String ElementCollectionMapping2_0_label; - public static String ElementCollectionMapping2_0_linkLabel; - - public static String AbstractElementCollectionMapping2_0_Composite_valueSectionTitle; - - public static String Entity_cacheableLabel; - public static String Entity_cacheableWithDefaultLabel; - - public static String OrderingComposite_orderColumn; - - public static String OrphanRemoval2_0Composite_orphanRemovalLabel; - public static String OrphanRemoval2_0Composite_orphanRemovalLabelDefault; - - public static String LockModeComposite_lockModeLabel; - - public static String LockModeComposite_read; - public static String LockModeComposite_write; - public static String LockModeComposite_optimistic; - public static String LockModeComposite_optimistic_force_increment; - public static String LockModeComposite_pessimistic_read; - public static String LockModeComposite_pessimistic_write; - public static String LockModeComposite_pessimistic_force_increment; - public static String LockModeComposite_none; - - public static String TargetClassComposite_label; - - private static final String BUNDLE_NAME = "jpt_ui_details2_0"; //$NON-NLS-1$ - private static final Class<?> BUNDLE_CLASS = JptUiDetailsMessages2_0.class; - static { - NLS.initializeMessages(BUNDLE_NAME, BUNDLE_CLASS); - } - - private JptUiDetailsMessages2_0() { - throw new UnsupportedOperationException(); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/LockModeComposite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/LockModeComposite.java deleted file mode 100644 index d0bc9ee716..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/LockModeComposite.java +++ /dev/null @@ -1,89 +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.ui.internal.jpa2.details; - -import java.util.Collection; - -import org.eclipse.jpt.core.jpa2.context.LockModeType_2_0; -import org.eclipse.jpt.core.jpa2.context.NamedQuery2_0; -import org.eclipse.jpt.ui.internal.widgets.EnumFormComboViewer; -import org.eclipse.jpt.ui.internal.widgets.Pane; -import org.eclipse.swt.widgets.Composite; - -/** - * LockModeComposite - */ -public class LockModeComposite extends Pane<NamedQuery2_0> -{ - /** - * Creates a new <code>LockModeComposite</code>. - * - * @param parentPane The parent container of this one - * @param parent The parent container - */ - public LockModeComposite(Pane<? extends NamedQuery2_0> parentPane, - Composite parent) { - - super(parentPane, parent); - } - - @Override - protected void initializeLayout(Composite container) { - - this.addLabeledComposite( - container, - JptUiDetailsMessages2_0.LockModeComposite_lockModeLabel, - this.addLockModeTypeCombo(container), - null // TODO - ); - } - - private EnumFormComboViewer<NamedQuery2_0, LockModeType_2_0> addLockModeTypeCombo(Composite container) { - - return new EnumFormComboViewer<NamedQuery2_0, LockModeType_2_0>(this, container) { - - @Override - protected void addPropertyNames(Collection<String> propertyNames) { - super.addPropertyNames(propertyNames); - propertyNames.add(NamedQuery2_0.DEFAULT_LOCK_MODE_PROPERTY); - propertyNames.add(NamedQuery2_0.SPECIFIED_LOCK_MODE_PROPERTY); - } - - @Override - protected LockModeType_2_0[] getChoices() { - return LockModeType_2_0.values(); - } - - @Override - protected LockModeType_2_0 getDefaultValue() { - return this.getSubject().getDefaultLockMode(); - } - - @Override - protected String displayString(LockModeType_2_0 value) { - return this.buildDisplayString( - JptUiDetailsMessages2_0.class, - LockModeComposite.this, - value - ); - } - - @Override - protected LockModeType_2_0 getValue() { - return this.getSubject().getSpecifiedLockMode(); - } - - @Override - protected void setValue(LockModeType_2_0 value) { - this.getSubject().setSpecifiedLockMode(value); - } - }; - } -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/NamedQueryProperty2_0Composite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/NamedQueryProperty2_0Composite.java deleted file mode 100644 index a673a5b00e..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/NamedQueryProperty2_0Composite.java +++ /dev/null @@ -1,67 +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.ui.internal.jpa2.details; - -import org.eclipse.jpt.core.jpa2.context.NamedQuery2_0; -import org.eclipse.jpt.ui.internal.details.JptUiDetailsMessages; -import org.eclipse.jpt.ui.internal.details.NamedQueryPropertyComposite; -import org.eclipse.jpt.ui.internal.details.QueryHintsComposite; -import org.eclipse.jpt.ui.internal.widgets.Pane; -import org.eclipse.jpt.utility.model.value.PropertyValueModel; -import org.eclipse.swt.widgets.Composite; - -/** - * NamedQueryProperty2_0Composite - */ -public class NamedQueryProperty2_0Composite extends NamedQueryPropertyComposite<NamedQuery2_0> -{ - /** - * Creates a new <code>NamedQueryProperty2_0Composite</code>. - * - * @param parentPane The parent container of this one - * @param subjectHolder The holder of this pane's subject - * @param parent The parent container - */ - public NamedQueryProperty2_0Composite(Pane<?> parentPane, - PropertyValueModel<NamedQuery2_0> subjectHolder, - Composite parent) { - - super(parentPane, subjectHolder, parent); - } - - @Override - protected void initializeLayout(Composite container) { - - this.addLabeledText( - container, - JptUiDetailsMessages.NamedQueryComposite_nameTextLabel, - this.buildNameTextHolder()); - - // Query text area - this.addLabeledMultiLineText( - container, - JptUiDetailsMessages.NamedQueryPropertyComposite_query, - this.buildQueryHolder(), - 4, - null - ); - - new LockModeComposite(this, container); - - // Query Hints pane - container = this.addTitledGroup( - this.addSubPane(container, 5), - JptUiDetailsMessages.NamedQueryPropertyComposite_queryHintsGroupBox - ); - - new QueryHintsComposite(this, container); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/OrderColumnComposite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/OrderColumnComposite.java deleted file mode 100644 index f94e9e3594..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/OrderColumnComposite.java +++ /dev/null @@ -1,374 +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.ui.internal.jpa2.details; - -import java.util.Collection; - -import org.eclipse.jpt.core.context.BaseColumn; -import org.eclipse.jpt.core.context.NamedColumn; -import org.eclipse.jpt.core.jpa2.context.OrderColumn2_0; -import org.eclipse.jpt.db.Table; -import org.eclipse.jpt.ui.internal.JpaHelpContextIds; -import org.eclipse.jpt.ui.internal.details.JptUiDetailsMessages; -import org.eclipse.jpt.ui.internal.details.db.ColumnCombo; -import org.eclipse.jpt.ui.internal.util.PaneEnabler; -import org.eclipse.jpt.ui.internal.widgets.Pane; -import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter; -import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel; -import org.eclipse.jpt.utility.internal.model.value.TransformationPropertyValueModel; -import org.eclipse.jpt.utility.model.value.PropertyValueModel; -import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel; -import org.eclipse.osgi.util.NLS; -import org.eclipse.swt.widgets.Composite; - -/** - * Here the layout of this pane: - * <pre> - * ----------------------------------------------------------------------------- - * | ------------------------------------------------------------------------- | - * | | | | - * | | ColumnCombo | | - * | | | | - * | ------------------------------------------------------------------------- | - * | | - * | > Details | - * | | - * | x Insertable | - * | | - * | x Updatable | - * | | - * | x Nullable | - * | | - * | ---------------------------------------------------- | - * | Column Definition: | I | | - * | ---------------------------------------------------- | - * -----------------------------------------------------------------------------</pre> - * * - * @version 3.0 - * @since 3.0 - */ -public class OrderColumnComposite extends Pane<OrderColumn2_0> { - - /** - * Creates a new <code>ColumnComposite</code>. - * - * @param parentPane The parent container of this one - * @param subjectHolder The holder of the subject <code>IColumn</code> - * @param parent The parent container - */ - public OrderColumnComposite(Pane<?> parentPane, - PropertyValueModel<? extends OrderColumn2_0> subjectHolder, - Composite parent) { - - super(parentPane, subjectHolder, parent, false); - } - - /** - * Creates a new <code>ColumnComposite</code>. - * - * @param parentPane The parent container of this one - * @param subjectHolder The holder of the subject <code>IColumn</code> - * @param parent The parent container - * @param automaticallyAlignWidgets <code>true</code> to make the widgets - * this pane aligned with the widgets of the given parent controller; - * <code>false</code> to not align them - */ - public OrderColumnComposite(Pane<?> parentPane, - PropertyValueModel<? extends OrderColumn2_0> subjectHolder, - Composite parent, - boolean automaticallyAlignWidgets) { - - super(parentPane, subjectHolder, parent, automaticallyAlignWidgets); - } - - /** - * Creates a new <code>ColumnComposite</code>. - * - * @param parentPane The parent container of this one - * @param subjectHolder The holder of the subject <code>IColumn</code> - * @param parent The parent container - * @param automaticallyAlignWidgets <code>true</code> to make the widgets - * this pane aligned with the widgets of the given parent controller; - * <code>false</code> to not align them - */ - public OrderColumnComposite(Pane<?> parentPane, - PropertyValueModel<? extends OrderColumn2_0> subjectHolder, - Composite parent, - boolean automaticallyAlignWidgets, - boolean parentManagePane) { - - super(parentPane, subjectHolder, parent, automaticallyAlignWidgets, parentManagePane); - } - - private ColumnCombo<OrderColumn2_0> addColumnCombo(Composite container) { - - return new ColumnCombo<OrderColumn2_0>(this, container) { - - @Override - protected void addPropertyNames(Collection<String> propertyNames) { - super.addPropertyNames(propertyNames); - propertyNames.add(NamedColumn.DEFAULT_NAME_PROPERTY); - propertyNames.add(NamedColumn.SPECIFIED_NAME_PROPERTY); - } - - @Override - protected String getDefaultValue() { - return getSubject().getDefaultName(); - } - - @Override - protected void setValue(String value) { - getSubject().setSpecifiedName(value); - } - - @Override - protected Table getDbTable_() { - return getSubject().getDbTable(); - } - - @Override - protected String getValue() { - return getSubject().getSpecifiedName(); - } - @Override - public String toString() { - return "OrderColumnComposite.columnCombo"; //$NON-NLS-1$ - } - }; - } - - private WritablePropertyValueModel<String> buildColumnDefinitionHolder() { - return new PropertyAspectAdapter<OrderColumn2_0, String>(getSubjectHolder(), NamedColumn.COLUMN_DEFINITION_PROPERTY) { - @Override - protected String buildValue_() { - return this.subject.getColumnDefinition(); - } - - @Override - protected void setValue_(String value) { - if (value.length() == 0) { - value = null; - } - this.subject.setColumnDefinition(value); - } - }; - } - - private WritablePropertyValueModel<Boolean> buildInsertableHolder() { - return new PropertyAspectAdapter<OrderColumn2_0, Boolean>(getSubjectHolder(), BaseColumn.SPECIFIED_INSERTABLE_PROPERTY) { - @Override - protected Boolean buildValue_() { - return this.subject.getSpecifiedInsertable(); - } - - @Override - protected void setValue_(Boolean value) { - this.subject.setSpecifiedInsertable(value); - } - }; - } - - private PropertyValueModel<String> buildInsertableStringHolder() { - return new TransformationPropertyValueModel<Boolean, String>(buildDefaultInsertableHolder()) { - @Override - protected String transform(Boolean value) { - if (value != null) { - String defaultStringValue = value.booleanValue() ? JptUiDetailsMessages.Boolean_True : JptUiDetailsMessages.Boolean_False; - return NLS.bind(JptUiDetailsMessages.ColumnComposite_insertableWithDefault, defaultStringValue); - } - return JptUiDetailsMessages.ColumnComposite_insertable; - } - }; - } - - private PropertyValueModel<Boolean> buildDefaultInsertableHolder() { - return new PropertyAspectAdapter<OrderColumn2_0, Boolean>( - getSubjectHolder(), - BaseColumn.SPECIFIED_INSERTABLE_PROPERTY, - BaseColumn.DEFAULT_INSERTABLE_PROPERTY) - { - @Override - protected Boolean buildValue_() { - if (this.subject.getSpecifiedInsertable() != null) { - return null; - } - return Boolean.valueOf(this.subject.isDefaultInsertable()); - } - }; - } - - private WritablePropertyValueModel<Boolean> buildNullableHolder() { - return new PropertyAspectAdapter<OrderColumn2_0, Boolean>( - getSubjectHolder(), - BaseColumn.SPECIFIED_NULLABLE_PROPERTY) - { - @Override - protected Boolean buildValue_() { - return this.subject.getSpecifiedNullable(); - } - - @Override - protected void setValue_(Boolean value) { - this.subject.setSpecifiedNullable(value); - } - }; - } - - private PropertyValueModel<String> buildNullableStringHolder() { - return new TransformationPropertyValueModel<Boolean, String>(buildDefaultNullableHolder()) { - @Override - protected String transform(Boolean value) { - if (value != null) { - String defaultStringValue = value.booleanValue() ? JptUiDetailsMessages.Boolean_True : JptUiDetailsMessages.Boolean_False; - return NLS.bind(JptUiDetailsMessages.ColumnComposite_nullableWithDefault, defaultStringValue); - } - return JptUiDetailsMessages.ColumnComposite_nullable; - } - }; - } - - private PropertyValueModel<Boolean> buildDefaultNullableHolder() { - return new PropertyAspectAdapter<OrderColumn2_0, Boolean>( - getSubjectHolder(), - BaseColumn.SPECIFIED_NULLABLE_PROPERTY, - BaseColumn.DEFAULT_NULLABLE_PROPERTY) - { - @Override - protected Boolean buildValue_() { - if (this.subject.getSpecifiedNullable() != null) { - return null; - } - return Boolean.valueOf(this.subject.isDefaultNullable()); - } - }; - } - - - private WritablePropertyValueModel<Boolean> buildUpdatableHolder() { - return new PropertyAspectAdapter<OrderColumn2_0, Boolean>( - getSubjectHolder(), - BaseColumn.DEFAULT_UPDATABLE_PROPERTY, - BaseColumn.SPECIFIED_UPDATABLE_PROPERTY) - { - @Override - protected Boolean buildValue_() { - return this.subject.getSpecifiedUpdatable(); - } - - @Override - protected void setValue_(Boolean value) { - this.subject.setSpecifiedUpdatable(value); - } - }; - } - - private PropertyValueModel<String> buildUpdatableStringHolder() { - - return new TransformationPropertyValueModel<Boolean, String>(buildDefaultUpdatableHolder()) { - - @Override - protected String transform(Boolean value) { - if (value != null) { - String defaultStringValue = value.booleanValue() ? JptUiDetailsMessages.Boolean_True : JptUiDetailsMessages.Boolean_False; - return NLS.bind(JptUiDetailsMessages.ColumnComposite_updatableWithDefault, defaultStringValue); - } - return JptUiDetailsMessages.ColumnComposite_updatable; - } - }; - } - - private PropertyValueModel<Boolean> buildDefaultUpdatableHolder() { - return new PropertyAspectAdapter<OrderColumn2_0, Boolean>( - getSubjectHolder(), - BaseColumn.SPECIFIED_UPDATABLE_PROPERTY, - BaseColumn.DEFAULT_UPDATABLE_PROPERTY) - { - @Override - protected Boolean buildValue_() { - if (this.subject.getSpecifiedUpdatable() != null) { - return null; - } - return Boolean.valueOf(this.subject.isDefaultUpdatable()); - } - }; - } - - @Override - protected void initializeLayout(Composite container) { - // Column widgets - addLabeledComposite( - container, - JptUiDetailsMessages.ColumnComposite_name, - addColumnCombo(container), - JpaHelpContextIds.MAPPING_ORDER_COLUMN_ORDERING_COLUMN - ); - - // Details sub-pane - container = addCollapsibleSubSection( - container, - JptUiDetailsMessages.ColumnComposite_details, - new SimplePropertyValueModel<Boolean>(Boolean.FALSE) - ); - - new DetailsComposite(this, getSubjectHolder(), addSubPane(container, 0, 16)); - } - - protected void installPaneEnabler(PropertyValueModel<Boolean> booleanHolder) { - new PaneEnabler(booleanHolder, this); - } - - protected class DetailsComposite extends Pane<OrderColumn2_0> { - - public DetailsComposite(Pane<?> parentPane, - PropertyValueModel<? extends OrderColumn2_0> subjectHolder, - Composite parent) { - - super(parentPane, subjectHolder, parent, false); - } - - @Override - protected void initializeLayout(Composite container) { - - // Insertable tri-state check box - addTriStateCheckBoxWithDefault( - addSubPane(container, 4), - JptUiDetailsMessages.ColumnComposite_insertable, - buildInsertableHolder(), - buildInsertableStringHolder(), - JpaHelpContextIds.MAPPING_COLUMN_INSERTABLE - ); - - // Updatable tri-state check box - addTriStateCheckBoxWithDefault( - container, - JptUiDetailsMessages.ColumnComposite_updatable, - buildUpdatableHolder(), - buildUpdatableStringHolder(), - JpaHelpContextIds.MAPPING_COLUMN_UPDATABLE - ); - - // Nullable tri-state check box - addTriStateCheckBoxWithDefault( - container, - JptUiDetailsMessages.ColumnComposite_nullable, - buildNullableHolder(), - buildNullableStringHolder(), - JpaHelpContextIds.MAPPING_COLUMN_NULLABLE - ); - - // Column Definition widgets - addLabeledText( - container, - JptUiDetailsMessages.ColumnComposite_columnDefinition, - buildColumnDefinitionHolder() - ); - } - } -}
\ No newline at end of file diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/Ordering2_0Composite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/Ordering2_0Composite.java deleted file mode 100644 index e06b0151b5..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/Ordering2_0Composite.java +++ /dev/null @@ -1,170 +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.ui.internal.jpa2.details; - -import org.eclipse.jpt.core.context.CollectionMapping; -import org.eclipse.jpt.core.context.Orderable; -import org.eclipse.jpt.core.jpa2.context.OrderColumn2_0; -import org.eclipse.jpt.core.jpa2.context.Orderable2_0; -import org.eclipse.jpt.ui.WidgetFactory; -import org.eclipse.jpt.ui.internal.JpaHelpContextIds; -import org.eclipse.jpt.ui.internal.details.AbstractOrderingComposite; -import org.eclipse.jpt.ui.internal.details.JptUiDetailsMessages; -import org.eclipse.jpt.ui.internal.util.PaneEnabler; -import org.eclipse.jpt.ui.internal.widgets.Pane; -import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter; -import org.eclipse.jpt.utility.model.value.PropertyValueModel; -import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Text; - -/** - * Here the layout of this pane: - * <pre> - * ----------------------------------------------------------------------------- - * | - Ordering -------------------------------------------------------------- | - * | | | | - * | | o None | | - * | | | | - * | | o Primary Key | | - * | | | | - * | | o Custom | | - * | | ------------------------------------------------------------------- | | - * | | | I | | | - * | | ------------------------------------------------------------------- | | - * | ------------------------------------------------------------------------- | - * -----------------------------------------------------------------------------</pre> - * - * @see CollectionMapping - * @see ManyToManyMappingComposite - A container of this pane - * @see OneToManyMappingComposite - A container of this pane - * - * @version 3.0 - * @since 1.0 - */ -public class Ordering2_0Composite extends AbstractOrderingComposite -{ - /** - * Creates a new <code>OrderingComposite</code>. - * - * @param parentPane The parent container of this one - * @param parent The parent container - */ - public Ordering2_0Composite(Pane<? extends CollectionMapping> parentPane, - Composite parent) { - - super(parentPane, parent); - } - - /** - * Creates a new <code>OrderingComposite</code>. - * - * @param subjectHolder The holder of the subject <code>IMultiRelationshipMapping</code> - * @param parent The parent container - * @param widgetFactory The factory used to create various common widgets - */ - public Ordering2_0Composite(PropertyValueModel<? extends CollectionMapping> subjectHolder, - Composite parent, - WidgetFactory widgetFactory) { - - super(subjectHolder, parent, widgetFactory); - } - - @Override - protected void initializeLayout(Composite container) { - PropertyValueModel<Orderable> orderableHolder = buildOrderableHolder(); - - container = addCollapsibleSection( - container, - JptUiDetailsMessages.OrderingComposite_orderingGroup - ); - - // No Ordering radio button - addRadioButton( - container, - JptUiDetailsMessages.OrderingComposite_none, - buildNoOrderingHolder(orderableHolder), - JpaHelpContextIds.MAPPING_ORDER_BY_NO_ORDERING - ); - - // Order by Primary Key radio button - addRadioButton( - container, - JptUiDetailsMessages.OrderingComposite_primaryKey, - buildPrimaryKeyOrderingHolder(orderableHolder), - JpaHelpContextIds.MAPPING_ORDER_BY_PRIMARY_KEY_ORDERING - ); - - // Custom Ordering radio button - addRadioButton( - container, - JptUiDetailsMessages.OrderingComposite_custom, - buildCustomOrderingHolder(orderableHolder), - JpaHelpContextIds.MAPPING_ORDER_BY_CUSTOM_ORDERING - ); - - // Custom Ordering text field - Text customOrderingText = addUnmanagedText( - addSubPane(container, 0, 16), - buildSpecifiedOrderByHolder(orderableHolder), - JpaHelpContextIds.MAPPING_ORDER_BY - ); - - installCustomTextEnabler(customOrderingText, orderableHolder); - - - // Order Column Ordering radio button - addRadioButton( - container, - JptUiDetailsMessages2_0.OrderingComposite_orderColumn, - buildOrderColumnOrderingHolder(orderableHolder), - JpaHelpContextIds.MAPPING_ORDER_COLUMN_ORDERING - ); - - OrderColumnComposite orderColumnComposite = new OrderColumnComposite( - this, - buildOrderColumnHolder(orderableHolder), - addSubPane(container, 0, 16)); - - installOrderColumnCompositeEnabler(orderableHolder, orderColumnComposite); - } - - protected void installOrderColumnCompositeEnabler(PropertyValueModel<Orderable> orderableHolder, OrderColumnComposite pane) { - new PaneEnabler(buildPaneEnablerHolder(orderableHolder), pane); - } - - private PropertyValueModel<Boolean> buildPaneEnablerHolder(PropertyValueModel<Orderable> orderableHolder) { - return buildOrderColumnOrderingHolder(orderableHolder); - } - - - protected WritablePropertyValueModel<Boolean> buildOrderColumnOrderingHolder(PropertyValueModel<Orderable> orderableHolder) { - return new PropertyAspectAdapter<Orderable, Boolean>(orderableHolder, Orderable2_0.ORDER_COLUMN_ORDERING_PROPERTY) { - @Override - protected Boolean buildValue_() { - return Boolean.valueOf(((Orderable2_0) this.subject).isOrderColumnOrdering()); - } - - @Override - protected void setValue_(Boolean value) { - ((Orderable2_0) this.subject).setOrderColumnOrdering(value.booleanValue()); - } - }; - } - - protected PropertyValueModel<OrderColumn2_0> buildOrderColumnHolder(PropertyValueModel<Orderable> orderableHolder) { - return new PropertyAspectAdapter<Orderable, OrderColumn2_0>(orderableHolder) { - @Override - protected OrderColumn2_0 buildValue_() { - return ((Orderable2_0) this.subject).getOrderColumn(); - } - }; - } -}
\ No newline at end of file diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/OrphanRemoval2_0Composite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/OrphanRemoval2_0Composite.java deleted file mode 100644 index 58a4dc25e5..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/OrphanRemoval2_0Composite.java +++ /dev/null @@ -1,111 +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.ui.internal.jpa2.details; - -import org.eclipse.jpt.core.context.RelationshipMapping; -import org.eclipse.jpt.core.jpa2.context.OrphanRemovable2_0; -import org.eclipse.jpt.ui.internal.details.JptUiDetailsMessages; -import org.eclipse.jpt.ui.internal.widgets.Pane; -import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter; -import org.eclipse.jpt.utility.internal.model.value.TransformationPropertyValueModel; -import org.eclipse.jpt.utility.model.value.PropertyValueModel; -import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel; -import org.eclipse.osgi.util.NLS; -import org.eclipse.swt.widgets.Composite; - -/** - * Here the layout of this pane: - * <pre> - * ----------------------------------------------------------------------------- - * | ------------------------------------------------------------------------- | - * | | | | - * | | [X] Orphan removal (true/false) | | - * | | | | - * | ------------------------------------------------------------------------- | - * -----------------------------------------------------------------------------</pre> - * - * @see {@link OrphanRemovable2_0} - * @see {@link JavaOneToOneMapping2_0Composite} - A container of this widget - * @see {@link OrmOneToOneMapping2_0Composite} - A container of this widget - */ -public class OrphanRemoval2_0Composite extends Pane<OrphanRemovable2_0> -{ - /** - * Creates a new <code>OrphanRemoval2_0Composite</code>. - * - * @param parentPane The parent container of this one - * @param parent The parent container - */ - public OrphanRemoval2_0Composite( - Pane<? extends RelationshipMapping> parentPane, - PropertyValueModel<? extends OrphanRemovable2_0> subjectHolder, - Composite parent) { - super(parentPane, subjectHolder, parent); - } - - @Override - protected void initializeLayout(Composite container) { - - this.addTriStateCheckBoxWithDefault( - container, - JptUiDetailsMessages2_0.OrphanRemoval2_0Composite_orphanRemovalLabel, - this.buildOrphanRemovalHolder(), - this.buildOrphanRemovalStringHolder(), - null // TODO - ); - } - private WritablePropertyValueModel<Boolean> buildOrphanRemovalHolder() { - return new PropertyAspectAdapter<OrphanRemovable2_0, Boolean>( - this.getSubjectHolder(), - OrphanRemovable2_0.DEFAULT_ORPHAN_REMOVAL_PROPERTY, - OrphanRemovable2_0.SPECIFIED_ORPHAN_REMOVAL_PROPERTY) { - @Override - protected Boolean buildValue_() { - return this.subject.getSpecifiedOrphanRemoval(); - } - - @Override - protected void setValue_(Boolean value) { - this.subject.setSpecifiedOrphanRemoval(value); - } - }; - } - - private PropertyValueModel<String> buildOrphanRemovalStringHolder() { - - return new TransformationPropertyValueModel<Boolean, String>(this.buildDefaultOrphanRemovalHolder()) { - @Override - protected String transform(Boolean value) { - if (value != null) { - String defaultStringValue = value.booleanValue() ? JptUiDetailsMessages.Boolean_True : JptUiDetailsMessages.Boolean_False; - return NLS.bind(JptUiDetailsMessages2_0.OrphanRemoval2_0Composite_orphanRemovalLabelDefault, defaultStringValue); - } - return JptUiDetailsMessages2_0.OrphanRemoval2_0Composite_orphanRemovalLabel; - } - }; - } - - private PropertyValueModel<Boolean> buildDefaultOrphanRemovalHolder() { - return new PropertyAspectAdapter<OrphanRemovable2_0, Boolean>( - this.getSubjectHolder(), - OrphanRemovable2_0.SPECIFIED_ORPHAN_REMOVAL_PROPERTY, - OrphanRemovable2_0.DEFAULT_ORPHAN_REMOVAL_PROPERTY) - { - @Override - protected Boolean buildValue_() { - if (this.subject.getSpecifiedOrphanRemoval() != null) { - return null; - } - return Boolean.valueOf(this.subject.isDefaultOrphanRemoval()); - } - }; - } - -}
\ No newline at end of file diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/Queries2_0Composite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/Queries2_0Composite.java deleted file mode 100644 index 59a4c6739b..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/Queries2_0Composite.java +++ /dev/null @@ -1,55 +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.ui.internal.jpa2.details; - -import org.eclipse.jpt.core.context.NamedQuery; -import org.eclipse.jpt.core.context.Query; -import org.eclipse.jpt.core.context.QueryContainer; -import org.eclipse.jpt.core.jpa2.context.NamedQuery2_0; -import org.eclipse.jpt.ui.internal.details.NamedQueryPropertyComposite; -import org.eclipse.jpt.ui.internal.details.QueriesComposite; -import org.eclipse.jpt.ui.internal.widgets.Pane; -import org.eclipse.jpt.utility.internal.model.value.TransformationPropertyValueModel; -import org.eclipse.jpt.utility.model.value.PropertyValueModel; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.ui.part.PageBook; - -/** - * Queries2_0Composite - */ -public class Queries2_0Composite - extends QueriesComposite -{ - public Queries2_0Composite( - Pane<?> parentPane, - PropertyValueModel<? extends QueryContainer> subjectHolder, - Composite parent) { - - super(parentPane, subjectHolder, parent); - } - - - @Override - protected NamedQueryPropertyComposite<NamedQuery2_0> buildNamedQueryPropertyComposite(PageBook pageBook) { - return new NamedQueryProperty2_0Composite( - this, - this.buildNamedQuery2_0Holder(), - pageBook); - } - - protected PropertyValueModel<NamedQuery2_0> buildNamedQuery2_0Holder() { - return new TransformationPropertyValueModel<Query, NamedQuery2_0>(this.getQueryHolder()) { - @Override - protected NamedQuery2_0 transform_(Query value) { - return (value instanceof NamedQuery) ? (NamedQuery2_0) value : null; - } - }; - } -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/SequenceGenerator2_0Composite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/SequenceGenerator2_0Composite.java deleted file mode 100644 index 5f1b2fe221..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/SequenceGenerator2_0Composite.java +++ /dev/null @@ -1,190 +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.ui.internal.jpa2.details; - -import java.util.Collection; - -import org.eclipse.jpt.core.JpaProject; -import org.eclipse.jpt.core.context.SequenceGenerator; -import org.eclipse.jpt.core.jpa2.context.SequenceGenerator2_0; -import org.eclipse.jpt.db.SchemaContainer; -import org.eclipse.jpt.ui.internal.JpaHelpContextIds; -import org.eclipse.jpt.ui.internal.details.JptUiDetailsMessages; -import org.eclipse.jpt.ui.internal.details.SequenceGeneratorComposite; -import org.eclipse.jpt.ui.internal.details.db.CatalogCombo; -import org.eclipse.jpt.ui.internal.details.db.SchemaCombo; -import org.eclipse.jpt.ui.internal.widgets.Pane; -import org.eclipse.jpt.utility.model.value.PropertyValueModel; -import org.eclipse.swt.widgets.Composite; - -/** - * JavaSequenceGenerator2_0Composite - */ -public class SequenceGenerator2_0Composite extends SequenceGeneratorComposite -{ - - public SequenceGenerator2_0Composite(Pane<?> parentPane, - PropertyValueModel<SequenceGenerator> subjectHolder, - Composite parent, - GeneratorBuilder<SequenceGenerator> builder) { - - super(parentPane, subjectHolder, parent, builder); - } - - @Override - protected void initializeLayout(Composite container) { - - // Name widgets - this.addLabeledText( - container, - JptUiDetailsMessages.SequenceGeneratorComposite_name, - this.buildGeneratorNameHolder(), - JpaHelpContextIds.MAPPING_SEQUENCE_GENERATOR_NAME - ); - - // Sequence Generator widgets - this.addLabeledComposite( - container, - JptUiDetailsMessages.SequenceGeneratorComposite_sequence, - this.buildSequenceNameCombo(container), - JpaHelpContextIds.MAPPING_SEQUENCE_GENERATOR_SEQUENCE - ); - - // Schema widgets - this.addLabeledComposite( - container, - JptUiDetailsMessages.SequenceGeneratorComposite_schema, - this.addSchemaCombo(container), - null // JpaHelpContextIds.MAPPING_SEQUENCE_GENERATOR_SCHEMA - ); - - // Catalog widgets - this.addLabeledComposite( - container, - JptUiDetailsMessages.SequenceGeneratorComposite_catalog, - this.addCatalogCombo(container), - null // JpaHelpContextIds.MAPPING_SEQUENCE_GENERATOR_CATALOG - ); - - this.addAllocationSizeCombo(container); - this.addInitialValueCombo(container); - } - - private SchemaCombo<SequenceGenerator> addSchemaCombo(Composite container) { - - return new SchemaCombo<SequenceGenerator>(this, getSubjectHolder(), container) { - - @Override - protected void addPropertyNames(Collection<String> propertyNames) { - super.addPropertyNames(propertyNames); - propertyNames.add(SequenceGenerator2_0.DEFAULT_SCHEMA_PROPERTY); - propertyNames.add(SequenceGenerator2_0.SPECIFIED_SCHEMA_PROPERTY); - propertyNames.add(SequenceGenerator2_0.DEFAULT_CATALOG_PROPERTY); - propertyNames.add(SequenceGenerator2_0.SPECIFIED_CATALOG_PROPERTY); - } - - @Override - protected void propertyChanged(String propertyName) { - if (propertyName == SequenceGenerator2_0.DEFAULT_CATALOG_PROPERTY - || propertyName == SequenceGenerator2_0.SPECIFIED_CATALOG_PROPERTY ) { - repopulateComboBox(); - } - else { - super.propertyChanged(propertyName); - } - } - - @Override - protected String getDefaultValue() { - return ((SequenceGenerator2_0) getSubject()).getDefaultSchema(); - } - - @Override - protected boolean nullSubjectIsAllowed() { - return true; - } - - /** - * subject may be null, so delegate to the composite - */ - @Override - protected JpaProject getJpaProject() { - return SequenceGenerator2_0Composite.this.getJpaProject(); - } - - @Override - protected void setValue(String value) { - ((SequenceGenerator2_0) SequenceGenerator2_0Composite.this.retrieveGenerator()).setSpecifiedSchema(value); - } - - @Override - protected String getValue() { - return ((SequenceGenerator2_0) getSubject()).getSpecifiedSchema(); - } - - @Override - protected SchemaContainer getDbSchemaContainer() { - SequenceGenerator2_0 tg = (SequenceGenerator2_0) this.getSubject(); - if (tg != null) { - return tg.getDbSchemaContainer(); - } - return SequenceGenerator2_0Composite.this.getSubject().getContextDefaultDbSchemaContainer(); - } - - @Override - protected SchemaContainer getDbSchemaContainer_() { - // we overrode #getDbSchemaContainer() instead - throw new UnsupportedOperationException(); - } - }; - } - - private CatalogCombo<SequenceGenerator> addCatalogCombo(Composite container) { - - return new CatalogCombo<SequenceGenerator>(this, getSubjectHolder(), container) { - - @Override - protected void addPropertyNames(Collection<String> propertyNames) { - super.addPropertyNames(propertyNames); - propertyNames.add(SequenceGenerator2_0.DEFAULT_CATALOG_PROPERTY); - propertyNames.add(SequenceGenerator2_0.SPECIFIED_CATALOG_PROPERTY); - } - - @Override - protected String getDefaultValue() { - return ((SequenceGenerator2_0) getSubject()).getDefaultCatalog(); - } - - @Override - protected boolean nullSubjectIsAllowed() { - return true; - } - - /** - * subject may be null, so delegate to the composite - */ - @Override - protected JpaProject getJpaProject() { - return SequenceGenerator2_0Composite.this.getJpaProject(); - } - - @Override - protected void setValue(String value) { - ((SequenceGenerator2_0) SequenceGenerator2_0Composite.this.retrieveGenerator()).setSpecifiedCatalog(value); - } - - @Override - protected String getValue() { - return ((SequenceGenerator2_0) getSubject()).getSpecifiedCatalog(); - } - }; - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/TargetClassComposite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/TargetClassComposite.java deleted file mode 100644 index a39f0069b8..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/TargetClassComposite.java +++ /dev/null @@ -1,130 +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.ui.internal.jpa2.details; - -import org.eclipse.jpt.core.JpaProject; -import org.eclipse.jpt.core.jpa2.context.ElementCollectionMapping2_0; -import org.eclipse.jpt.ui.internal.JpaHelpContextIds; -import org.eclipse.jpt.ui.internal.details.JptUiDetailsMessages; -import org.eclipse.jpt.ui.internal.widgets.ClassChooserComboPane; -import org.eclipse.jpt.ui.internal.widgets.Pane; -import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter; -import org.eclipse.jpt.utility.internal.model.value.PropertyListValueModelAdapter; -import org.eclipse.jpt.utility.model.value.ListValueModel; -import org.eclipse.jpt.utility.model.value.PropertyValueModel; -import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel; -import org.eclipse.osgi.util.NLS; -import org.eclipse.swt.widgets.Composite; - -/** - * target entity hyperlink label, combo and browse button - */ -public class TargetClassComposite extends ClassChooserComboPane<ElementCollectionMapping2_0> -{ - - /** - * Creates a new <code>TargetEntityComposite</code>. - * - * @param parentPane The parent container of this one - * @param parent The parent container - */ - public TargetClassComposite( - Pane<? extends ElementCollectionMapping2_0> parentPane, - Composite parent) { - - super(parentPane, parent); - } - - @Override - protected String getClassName() { - return getSubject().getTargetClass(); - } - - @Override - protected void setClassName(String className) { - this.getSubject().setSpecifiedTargetClass(className); - } - - @Override - protected char getEnclosingTypeSeparator() { - return getSubject().getTargetClassEnclosingTypeSeparator(); - } - - @Override - protected String getLabelText() { - return JptUiDetailsMessages2_0.TargetClassComposite_label; - } - - @Override - protected String getHelpId() { - return JpaHelpContextIds.MAPPING_ELEMENT_COLLECTION_TARGET_CLASS; - } - - @Override - protected JpaProject getJpaProject() { - return getSubject().getJpaProject(); - } - - @Override - protected WritablePropertyValueModel<String> buildTextHolder() { - return new PropertyAspectAdapter<ElementCollectionMapping2_0, String>(this.getSubjectHolder(), ElementCollectionMapping2_0.SPECIFIED_TARGET_CLASS_PROPERTY) { - @Override - protected String buildValue_() { - - String name = this.subject.getSpecifiedTargetClass(); - if (name == null) { - name = TargetClassComposite.this.getDefaultValue(this.subject); - } - return name; - } - - @Override - protected void setValue_(String value) { - - if (getDefaultValue(this.subject).equals(value)) { - value = null; - } - this.subject.setSpecifiedTargetClass(value); - } - }; - } - - @Override - protected ListValueModel<String> buildClassListHolder() { - return this.buildDefaultProfilerListHolder(); - } - - private ListValueModel<String> buildDefaultProfilerListHolder() { - return new PropertyListValueModelAdapter<String>( - this.buildDefaultProfilerHolder() - ); - } - - private PropertyValueModel<String> buildDefaultProfilerHolder() { - return new PropertyAspectAdapter<ElementCollectionMapping2_0, String>(this.getSubjectHolder(), ElementCollectionMapping2_0.DEFAULT_TARGET_CLASS_PROPERTY) { - @Override - protected String buildValue_() { - return TargetClassComposite.this.getDefaultValue(this.subject); - } - }; - } - - private String getDefaultValue(ElementCollectionMapping2_0 subject) { - String defaultValue = subject.getDefaultTargetClass(); - - if (defaultValue != null) { - return NLS.bind( - JptUiDetailsMessages.DefaultWithOneParam, - defaultValue - ); - } - return JptUiDetailsMessages.DefaultEmpty; - } -}
\ No newline at end of file diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/java/Generic2_0JavaResourceUiDefinition.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/java/Generic2_0JavaResourceUiDefinition.java deleted file mode 100644 index bec9e7ebd3..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/java/Generic2_0JavaResourceUiDefinition.java +++ /dev/null @@ -1,91 +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.ui.internal.jpa2.details.java; - -import java.util.List; -import org.eclipse.jpt.core.context.AttributeMapping; -import org.eclipse.jpt.core.context.TypeMapping; -import org.eclipse.jpt.ui.ResourceUiDefinition; -import org.eclipse.jpt.ui.details.java.DefaultJavaAttributeMappingUiDefinition; -import org.eclipse.jpt.ui.details.java.JavaAttributeMappingUiDefinition; -import org.eclipse.jpt.ui.details.java.JavaTypeMappingUiDefinition; -import org.eclipse.jpt.ui.details.java.JavaUiFactory; -import org.eclipse.jpt.ui.internal.details.java.AbstractJavaResourceUiDefinition; -import org.eclipse.jpt.ui.internal.details.java.DefaultBasicMappingUiDefinition; -import org.eclipse.jpt.ui.internal.details.java.DefaultEmbeddedMappingUiDefinition; -import org.eclipse.jpt.ui.internal.details.java.JavaBasicMappingUiDefinition; -import org.eclipse.jpt.ui.internal.details.java.JavaEmbeddableUiDefinition; -import org.eclipse.jpt.ui.internal.details.java.JavaEmbeddedIdMappingUDefinition; -import org.eclipse.jpt.ui.internal.details.java.JavaEmbeddedMappingUiDefinition; -import org.eclipse.jpt.ui.internal.details.java.JavaEntityUiDefinition; -import org.eclipse.jpt.ui.internal.details.java.JavaIdMappingUiDefinition; -import org.eclipse.jpt.ui.internal.details.java.JavaManyToManyMappingUiDefinition; -import org.eclipse.jpt.ui.internal.details.java.JavaManyToOneMappingUiDefinition; -import org.eclipse.jpt.ui.internal.details.java.JavaMappedSuperclassUiDefinition; -import org.eclipse.jpt.ui.internal.details.java.JavaOneToManyMappingUiDefinition; -import org.eclipse.jpt.ui.internal.details.java.JavaOneToOneMappingUiDefinition; -import org.eclipse.jpt.ui.internal.details.java.JavaTransientMappingUiDefinition; -import org.eclipse.jpt.ui.internal.details.java.JavaVersionMappingUiDefinition; -import org.eclipse.jpt.ui.internal.details.java.NullJavaAttributeMappingUiDefinition; - -public class Generic2_0JavaResourceUiDefinition extends AbstractJavaResourceUiDefinition -{ - // singleton - private static final ResourceUiDefinition INSTANCE = new Generic2_0JavaResourceUiDefinition(); - - /** - * Return the singleton. - */ - public static ResourceUiDefinition instance() { - return INSTANCE; - } - - - /** - * zero-argument constructor - */ - protected Generic2_0JavaResourceUiDefinition() { - super(); - } - - @Override - protected JavaUiFactory buildJavaUiFactory() { - return new Generic2_0JavaUiFactory(); - } - - @Override - protected void addSpecifiedAttributeMappingUiDefinitionsTo(List<JavaAttributeMappingUiDefinition<? extends AttributeMapping>> definitions) { - definitions.add(JavaElementCollectionMapping2_0UiDefinition.instance()); - definitions.add(JavaIdMappingUiDefinition.instance()); - definitions.add(JavaEmbeddedIdMappingUDefinition.instance()); - definitions.add(JavaBasicMappingUiDefinition.instance()); - definitions.add(JavaVersionMappingUiDefinition.instance()); - definitions.add(JavaManyToOneMappingUiDefinition.instance()); - definitions.add(JavaOneToManyMappingUiDefinition.instance()); - definitions.add(JavaOneToOneMappingUiDefinition.instance()); - definitions.add(JavaManyToManyMappingUiDefinition.instance()); - definitions.add(JavaEmbeddedMappingUiDefinition.instance()); - definitions.add(JavaTransientMappingUiDefinition.instance()); - } - - @Override - protected void addDefaultAttributeMappingUiDefinitionsTo(List<DefaultJavaAttributeMappingUiDefinition<?>> definitions) { - definitions.add(DefaultBasicMappingUiDefinition.instance()); - definitions.add(DefaultEmbeddedMappingUiDefinition.instance()); - definitions.add(NullJavaAttributeMappingUiDefinition.instance()); - } - - @Override - protected void addSpecifiedTypeMappingUiDefinitionsTo(List<JavaTypeMappingUiDefinition<? extends TypeMapping>> definitions) { - definitions.add(JavaEntityUiDefinition.instance()); - definitions.add(JavaMappedSuperclassUiDefinition.instance()); - definitions.add(JavaEmbeddableUiDefinition.instance()); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/java/Generic2_0JavaUiFactory.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/java/Generic2_0JavaUiFactory.java deleted file mode 100644 index f55bb88976..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/java/Generic2_0JavaUiFactory.java +++ /dev/null @@ -1,120 +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.ui.internal.jpa2.details.java; - -import org.eclipse.jpt.core.context.java.JavaEmbeddable; -import org.eclipse.jpt.core.context.java.JavaEmbeddedMapping; -import org.eclipse.jpt.core.context.java.JavaEntity; -import org.eclipse.jpt.core.context.java.JavaIdMapping; -import org.eclipse.jpt.core.context.java.JavaManyToManyMapping; -import org.eclipse.jpt.core.context.java.JavaManyToOneMapping; -import org.eclipse.jpt.core.context.java.JavaMappedSuperclass; -import org.eclipse.jpt.core.context.java.JavaOneToManyMapping; -import org.eclipse.jpt.core.context.java.JavaOneToOneMapping; -import org.eclipse.jpt.core.jpa2.context.java.JavaElementCollectionMapping2_0; -import org.eclipse.jpt.ui.WidgetFactory; -import org.eclipse.jpt.ui.details.JpaComposite; -import org.eclipse.jpt.ui.internal.details.java.BaseJavaUiFactory; -import org.eclipse.jpt.ui.internal.jpa2.details.ElementCollectionMapping2_0Composite; -import org.eclipse.jpt.ui.internal.persistence.details.GenericPersistenceXmlUiFactory; -import org.eclipse.jpt.ui.jpa2.details.java.JavaUiFactory2_0; -import org.eclipse.jpt.utility.model.value.PropertyValueModel; -import org.eclipse.swt.widgets.Composite; - -/** - * The default implementation of the UI factory required to show the information - * related to a JPA mapping (type or attribute). - * - * @see GenericPersistenceXmlUiFactory - * - * @version 1.0 - * @since 1.0 - */ -public class Generic2_0JavaUiFactory - extends BaseJavaUiFactory - implements JavaUiFactory2_0 -{ - - @Override - public JpaComposite createJavaMappedSuperclassComposite( - PropertyValueModel<JavaMappedSuperclass> subjectHolder, - Composite parent, WidgetFactory widgetFactory) { - return new JavaMappedSuperclass2_0Composite(subjectHolder, parent, widgetFactory); - } - - @Override - public JpaComposite createJavaEntityComposite( - PropertyValueModel<JavaEntity> subjectHolder, - Composite parent, WidgetFactory widgetFactory) { - return new JavaEntity2_0Composite(subjectHolder, parent, widgetFactory); - } - - @Override - public JpaComposite createJavaEmbeddableComposite( - PropertyValueModel<JavaEmbeddable> subjectHolder, - Composite parent, WidgetFactory widgetFactory) { - return new JavaEmbeddable2_0Composite(subjectHolder, parent, widgetFactory); - } - - @Override - public JpaComposite createJavaIdMappingComposite( - PropertyValueModel<JavaIdMapping> subjectHolder, - Composite parent, - WidgetFactory widgetFactory) { - return new JavaIdMapping2_0Composite(subjectHolder, parent, widgetFactory); - } - - @Override - public JpaComposite createJavaEmbeddedMappingComposite( - PropertyValueModel<JavaEmbeddedMapping> subjectHolder, - Composite parent, - WidgetFactory widgetFactory) { - return new JavaEmbeddedMapping2_0Composite(subjectHolder, parent, widgetFactory); - } - - @Override - public JpaComposite createJavaManyToManyMappingComposite( - PropertyValueModel<JavaManyToManyMapping> subjectHolder, - Composite parent, - WidgetFactory widgetFactory) { - return new JavaManyToManyMapping2_0Composite(subjectHolder, parent, widgetFactory); - } - - @Override - public JpaComposite createJavaManyToOneMappingComposite( - PropertyValueModel<JavaManyToOneMapping> subjectHolder, - Composite parent, - WidgetFactory widgetFactory) { - return new JavaManyToOneMapping2_0Composite(subjectHolder, parent, widgetFactory); - } - - @Override - public JpaComposite createJavaOneToManyMappingComposite( - PropertyValueModel<JavaOneToManyMapping> subjectHolder, - Composite parent, - WidgetFactory widgetFactory) { - return new JavaOneToManyMapping2_0Composite(subjectHolder, parent, widgetFactory); - } - - @Override - public JpaComposite createJavaOneToOneMappingComposite( - PropertyValueModel<JavaOneToOneMapping> subjectHolder, - Composite parent, - WidgetFactory widgetFactory) { - return new JavaOneToOneMapping2_0Composite(subjectHolder, parent, widgetFactory); - } - - public JpaComposite createJavaElementCollectionMapping2_0Composite( - PropertyValueModel<JavaElementCollectionMapping2_0> subjectHolder, - Composite parent, - WidgetFactory widgetFactory) { - return new ElementCollectionMapping2_0Composite(subjectHolder, parent, widgetFactory); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/java/JavaElementCollectionMapping2_0UiDefinition.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/java/JavaElementCollectionMapping2_0UiDefinition.java deleted file mode 100644 index c93ff545a7..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/java/JavaElementCollectionMapping2_0UiDefinition.java +++ /dev/null @@ -1,52 +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.ui.internal.jpa2.details.java; - -import org.eclipse.jpt.core.jpa2.context.java.JavaElementCollectionMapping2_0; -import org.eclipse.jpt.ui.WidgetFactory; -import org.eclipse.jpt.ui.details.JpaComposite; -import org.eclipse.jpt.ui.details.java.JavaAttributeMappingUiDefinition; -import org.eclipse.jpt.ui.details.java.JavaUiFactory; -import org.eclipse.jpt.ui.internal.jpa2.details.AbstractElementCollectionMapping2_0UiDefinition; -import org.eclipse.jpt.ui.jpa2.details.java.JavaUiFactory2_0; -import org.eclipse.jpt.utility.model.value.PropertyValueModel; -import org.eclipse.swt.widgets.Composite; - -public class JavaElementCollectionMapping2_0UiDefinition - extends AbstractElementCollectionMapping2_0UiDefinition<JavaElementCollectionMapping2_0> - implements JavaAttributeMappingUiDefinition<JavaElementCollectionMapping2_0> -{ - // singleton - private static final JavaElementCollectionMapping2_0UiDefinition INSTANCE = - new JavaElementCollectionMapping2_0UiDefinition(); - - /** - * Return the singleton. - */ - public static JavaAttributeMappingUiDefinition<JavaElementCollectionMapping2_0> instance() { - return INSTANCE; - } - - - /** - * Ensure single instance. - */ - private JavaElementCollectionMapping2_0UiDefinition() { - super(); - } - - public JpaComposite buildAttributeMappingComposite( - JavaUiFactory factory, - PropertyValueModel<JavaElementCollectionMapping2_0> subjectHolder, - Composite parent, - WidgetFactory widgetFactory) { - return ((JavaUiFactory2_0) factory).createJavaElementCollectionMapping2_0Composite(subjectHolder, parent, widgetFactory); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/java/JavaEmbeddable2_0Composite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/java/JavaEmbeddable2_0Composite.java deleted file mode 100644 index 9227e8411d..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/java/JavaEmbeddable2_0Composite.java +++ /dev/null @@ -1,64 +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.ui.internal.jpa2.details.java; - -import org.eclipse.jpt.core.context.AccessHolder; -import org.eclipse.jpt.core.context.java.JavaEmbeddable; -import org.eclipse.jpt.ui.WidgetFactory; -import org.eclipse.jpt.ui.details.JpaComposite; -import org.eclipse.jpt.ui.internal.details.AccessTypeComposite; -import org.eclipse.jpt.ui.internal.widgets.Pane; -import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter; -import org.eclipse.jpt.utility.model.value.PropertyValueModel; -import org.eclipse.swt.widgets.Composite; - -/** - * This pane does not have any widgets. - * - * @see Embeddable - * @see EmbeddableUiProvider - * - * @version 2.0 - * @since 2.0 - */ -public class JavaEmbeddable2_0Composite extends Pane<JavaEmbeddable> - implements JpaComposite -{ - /** - * Creates a new <code>EmbeddableComposite</code>. - * - * @param subjectHolder The holder of this pane's subject - * @param parent The parent container - * @param widgetFactory The factory used to create various common widgets - */ - public JavaEmbeddable2_0Composite(PropertyValueModel<? extends JavaEmbeddable> subjectHolder, - Composite parent, - WidgetFactory widgetFactory) { - - super(subjectHolder, parent, widgetFactory); - } - - @Override - protected void initializeLayout(Composite container) { - new AccessTypeComposite(this, buildAccessHolder(), container); - } - - protected PropertyValueModel<AccessHolder> buildAccessHolder() { - return new PropertyAspectAdapter<JavaEmbeddable, AccessHolder>( - getSubjectHolder()) - { - @Override - protected AccessHolder buildValue_() { - return this.subject.getPersistentType(); - } - }; - } - -}
\ No newline at end of file diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/java/JavaEmbeddedMapping2_0Composite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/java/JavaEmbeddedMapping2_0Composite.java deleted file mode 100644 index b9942bf938..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/java/JavaEmbeddedMapping2_0Composite.java +++ /dev/null @@ -1,60 +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.ui.internal.jpa2.details.java; - -import org.eclipse.jpt.core.context.java.JavaEmbeddedMapping; -import org.eclipse.jpt.ui.WidgetFactory; -import org.eclipse.jpt.ui.details.JpaComposite; -import org.eclipse.jpt.ui.internal.jpa2.details.EmbeddedMapping2_0OverridesComposite; -import org.eclipse.jpt.ui.internal.widgets.Pane; -import org.eclipse.jpt.utility.model.value.PropertyValueModel; -import org.eclipse.swt.widgets.Composite; - -/** - * Here the layout of this pane: - * <pre> - * ----------------------------------------------------------------------------- - * | ------------------------------------------------------------------------- | - * | | | | - * | | EmbeddedAttributeOverridesComposite | | - * | | | | - * | ------------------------------------------------------------------------- | - * -----------------------------------------------------------------------------</pre> - * - * @see EmbeddedMapping - * - * @version 2.0 - * @since 1.0 - */ -public class JavaEmbeddedMapping2_0Composite extends Pane<JavaEmbeddedMapping> - implements JpaComposite -{ - /** - * 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 JavaEmbeddedMapping2_0Composite(PropertyValueModel<? extends JavaEmbeddedMapping> subjectHolder, - Composite parent, - WidgetFactory widgetFactory) { - - super(subjectHolder, parent, widgetFactory); - } - - @Override - protected void initializeLayout(Composite container) { - new EmbeddedMapping2_0OverridesComposite( - this, - container - ); - } -}
\ No newline at end of file diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/java/JavaEntity2_0Composite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/java/JavaEntity2_0Composite.java deleted file mode 100644 index cbb8ba071d..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/java/JavaEntity2_0Composite.java +++ /dev/null @@ -1,112 +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.ui.internal.jpa2.details.java; - -import org.eclipse.jpt.core.context.AccessHolder; -import org.eclipse.jpt.core.context.QueryContainer; -import org.eclipse.jpt.core.context.java.JavaEntity; -import org.eclipse.jpt.core.jpa2.context.Cacheable2_0; -import org.eclipse.jpt.core.jpa2.context.CacheableHolder2_0; -import org.eclipse.jpt.ui.WidgetFactory; -import org.eclipse.jpt.ui.internal.details.AbstractEntityComposite; -import org.eclipse.jpt.ui.internal.details.AccessTypeComposite; -import org.eclipse.jpt.ui.internal.details.EntityNameComposite; -import org.eclipse.jpt.ui.internal.details.IdClassComposite; -import org.eclipse.jpt.ui.internal.details.TableComposite; -import org.eclipse.jpt.ui.internal.details.java.JavaInheritanceComposite; -import org.eclipse.jpt.ui.internal.details.java.JavaSecondaryTablesComposite; -import org.eclipse.jpt.ui.internal.jpa2.details.Cacheable2_0Pane; -import org.eclipse.jpt.ui.internal.jpa2.details.Entity2_0OverridesComposite; -import org.eclipse.jpt.ui.internal.jpa2.details.Queries2_0Composite; -import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter; -import org.eclipse.jpt.utility.model.value.PropertyValueModel; -import org.eclipse.swt.widgets.Composite; - -/** - * The pane used for a Java entity. - * - * @see JavaEntity - * @see JavaSecondaryTablesComposite - * - * @version 2.0 - * @since 1.0 - */ -public class JavaEntity2_0Composite - extends AbstractEntityComposite<JavaEntity> -{ - /** - * Creates a new <code>JavaEntityComposite</code>. - * - * @param subjectHolder The holder of the subject <code>JavaEntity</code> - * @param parent The parent container - * @param widgetFactory The factory used to create various common widgets - */ - public JavaEntity2_0Composite( - PropertyValueModel<? extends JavaEntity> subjectHolder, - Composite parent, - WidgetFactory widgetFactory) { - - super(subjectHolder, parent, widgetFactory); - } - - - @Override - protected void initializeGeneralPane(Composite container) { - int groupBoxMargin = getGroupBoxMargin(); - - new TableComposite(this, container); - new EntityNameComposite( - this, addSubPane(container, 0, groupBoxMargin, 0, groupBoxMargin)); - new AccessTypeComposite( - this, buildAccessHolder(), addSubPane(container, 0, groupBoxMargin, 0, groupBoxMargin)); - new IdClassComposite( - this, buildIdClassReferenceHolder(), addSubPane(container, 0, groupBoxMargin, 0, groupBoxMargin), false); - new Cacheable2_0Pane( - this, buildCacheableHolder(), addSubPane(container, 0, groupBoxMargin, 0, groupBoxMargin)); - } - - protected PropertyValueModel<AccessHolder> buildAccessHolder() { - return new PropertyAspectAdapter<JavaEntity, AccessHolder>(getSubjectHolder()) { - @Override - protected AccessHolder buildValue_() { - return this.subject.getPersistentType(); - } - }; - } - - protected PropertyValueModel<Cacheable2_0> buildCacheableHolder() { - return new PropertyAspectAdapter<JavaEntity, Cacheable2_0>(getSubjectHolder()) { - @Override - protected Cacheable2_0 buildValue_() { - return ((CacheableHolder2_0) this.subject).getCacheable(); - } - }; - } - - @Override - protected void addSecondaryTablesComposite(Composite container) { - new JavaSecondaryTablesComposite(this, container); - } - - @Override - protected void addInheritanceComposite(Composite container) { - new JavaInheritanceComposite(this, container); - } - - @Override - protected void addAttributeOverridesComposite(Composite container) { - new Entity2_0OverridesComposite(this, container); - } - - @Override - protected void addQueriesComposite(Composite container, PropertyValueModel<QueryContainer> queryContainerHolder) { - new Queries2_0Composite(this, queryContainerHolder, container); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/java/JavaIdMapping2_0Composite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/java/JavaIdMapping2_0Composite.java deleted file mode 100644 index 35e0a3fcd6..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/java/JavaIdMapping2_0Composite.java +++ /dev/null @@ -1,51 +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.ui.internal.jpa2.details.java; - -import org.eclipse.jpt.core.context.IdMapping; -import org.eclipse.jpt.ui.WidgetFactory; -import org.eclipse.jpt.ui.internal.details.AbstractIdMappingComposite; -import org.eclipse.jpt.ui.internal.details.ColumnComposite; -import org.eclipse.jpt.ui.internal.jpa2.details.IdMappingGeneration2_0Composite; -import org.eclipse.jpt.utility.model.value.PropertyValueModel; -import org.eclipse.swt.widgets.Composite; - -/** - * JavaIdMapping2_0Composite - */ -public class JavaIdMapping2_0Composite extends AbstractIdMappingComposite<IdMapping> -{ - /** - * Creates a new <code>IdMappingComposite</code>. - * - * @param subjectHolder The holder of the subject <code>IIdMapping</code> - * @param parent The parent container - * @param widgetFactory The factory used to create various common widgets - */ - public JavaIdMapping2_0Composite(PropertyValueModel<? extends IdMapping> subjectHolder, - Composite parent, - WidgetFactory widgetFactory) { - - super(subjectHolder, parent, widgetFactory); - } - - @Override - protected void initializeLayout(Composite container) { - - // Column widgets - new ColumnComposite(this, buildColumnHolder(), container); - - initializeTypePane(container); - - // Generation pane - new IdMappingGeneration2_0Composite(this, addSubPane(container, 10)); - } - -}
\ No newline at end of file diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/java/JavaManyToManyMapping2_0Composite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/java/JavaManyToManyMapping2_0Composite.java deleted file mode 100644 index 104d6fb44f..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/java/JavaManyToManyMapping2_0Composite.java +++ /dev/null @@ -1,94 +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.ui.internal.jpa2.details.java; - -import org.eclipse.jpt.core.context.ManyToManyMapping; -import org.eclipse.jpt.core.context.java.JavaManyToManyMapping; -import org.eclipse.jpt.ui.WidgetFactory; -import org.eclipse.jpt.ui.internal.details.AbstractManyToManyMappingComposite; -import org.eclipse.jpt.ui.internal.details.CascadeComposite; -import org.eclipse.jpt.ui.internal.details.FetchTypeComposite; -import org.eclipse.jpt.ui.internal.details.ManyToManyJoiningStrategyPane; -import org.eclipse.jpt.ui.internal.details.OrderingComposite; -import org.eclipse.jpt.ui.internal.details.TargetEntityComposite; -import org.eclipse.jpt.ui.internal.jpa2.details.Ordering2_0Composite; -import org.eclipse.jpt.utility.model.value.PropertyValueModel; -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 3.0 - * @since 1.0 - */ -public class JavaManyToManyMapping2_0Composite - extends AbstractManyToManyMappingComposite<JavaManyToManyMapping> -{ - /** - * 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 JavaManyToManyMapping2_0Composite(PropertyValueModel<? extends JavaManyToManyMapping> subjectHolder, - Composite parent, - WidgetFactory widgetFactory) { - - super(subjectHolder, parent, widgetFactory); - } - - @Override - protected void initializeLayout(Composite container) { - int groupBoxMargin = getGroupBoxMargin(); - - new TargetEntityComposite(this, addPane(container, groupBoxMargin)); - new ManyToManyJoiningStrategyPane(this, buildJoiningHolder(), container); - new FetchTypeComposite(this, addPane(container, groupBoxMargin)); - new CascadeComposite(this, buildCascadeHolder(), addSubPane(container, 5)); - new Ordering2_0Composite(this, container); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/java/JavaManyToOneMapping2_0Composite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/java/JavaManyToOneMapping2_0Composite.java deleted file mode 100644 index 4f3a0ce345..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/java/JavaManyToOneMapping2_0Composite.java +++ /dev/null @@ -1,92 +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.ui.internal.jpa2.details.java; - -import org.eclipse.jpt.core.jpa2.context.java.JavaManyToOneMapping2_0; -import org.eclipse.jpt.ui.WidgetFactory; -import org.eclipse.jpt.ui.internal.details.CascadeComposite; -import org.eclipse.jpt.ui.internal.details.FetchTypeComposite; -import org.eclipse.jpt.ui.internal.details.ManyToOneJoiningStrategyPane; -import org.eclipse.jpt.ui.internal.details.OptionalComposite; -import org.eclipse.jpt.ui.internal.details.TargetEntityComposite; -import org.eclipse.jpt.ui.internal.jpa2.details.AbstractManyToOneMapping2_0Composite; -import org.eclipse.jpt.ui.internal.jpa2.details.DerivedIdentity2_0Pane; -import org.eclipse.jpt.utility.model.value.PropertyValueModel; -import org.eclipse.swt.widgets.Composite; - -/** - * Here the layout of this pane: - * <pre> - * ----------------------------------------------------------------------------- - * | ------------------------------------------------------------------------- | - * | | | | - * | | TargetEntityComposite | | - * | | | | - * | ------------------------------------------------------------------------- | - * | ------------------------------------------------------------------------- | - * | | | | - * | | DerivedIdentity2_0Pane | | - * | | | | - * | ------------------------------------------------------------------------- | - * | ------------------------------------------------------------------------- | - * | | | | - * | | ManyToOneJoiningStrategyPane | | - * | | | | - * | ------------------------------------------------------------------------- | - * | ------------------------------------------------------------------------- | - * | | | | - * | | FetchTypeComposite | | - * | | | | - * | ------------------------------------------------------------------------- | - * | ------------------------------------------------------------------------- | - * | | | | - * | | OptionalComposite | | - * | | | | - * | ------------------------------------------------------------------------- | - * | ------------------------------------------------------------------------- | - * | | | | - * | | CascadeComposite | | - * | | | | - * | ------------------------------------------------------------------------- | - * -----------------------------------------------------------------------------</pre> - * - * @see {@link JavaManyToOneMapping2_0} - * @see {@link TargetEntityComposite} - * @see {@link DerivedId2_0Pane} - * @see {@link ManyToOneJoiningStrategyPane} - * @see {@link FetchTypeComposite} - * @see {@link OptionalComposite} - * @see {@link CascadeComposite} - */ -public class JavaManyToOneMapping2_0Composite<T extends JavaManyToOneMapping2_0> - extends AbstractManyToOneMapping2_0Composite<T> -{ - public JavaManyToOneMapping2_0Composite( - PropertyValueModel<T> subjectHolder, - Composite parent, - WidgetFactory widgetFactory) { - - super(subjectHolder, parent, widgetFactory); - } - - - @Override - protected void initializeLayout(Composite container) { - int groupBoxMargin = getGroupBoxMargin(); - - new TargetEntityComposite(this, addPane(container, groupBoxMargin)); - new DerivedIdentity2_0Pane(this, buildDerivedIdentityHolder(), container); - new ManyToOneJoiningStrategyPane(this, buildJoiningHolder(), container); - new FetchTypeComposite(this, addPane(container, groupBoxMargin)); - new OptionalComposite(this, addPane(container, groupBoxMargin)); - new CascadeComposite(this, buildCascadeHolder(), addSubPane(container, 5)); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/java/JavaManyToOneMapping2_0Pane.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/java/JavaManyToOneMapping2_0Pane.java deleted file mode 100644 index ab5440cef1..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/java/JavaManyToOneMapping2_0Pane.java +++ /dev/null @@ -1,4 +0,0 @@ -package org.eclipse.jpt.ui.internal.jpa2.details.java; - -public class JavaManyToOneMapping2_0Pane -{} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/java/JavaMappedSuperclass2_0Composite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/java/JavaMappedSuperclass2_0Composite.java deleted file mode 100644 index 9cdaf1d63b..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/java/JavaMappedSuperclass2_0Composite.java +++ /dev/null @@ -1,85 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 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.ui.internal.jpa2.details.java; - -import org.eclipse.jpt.core.context.AccessHolder; -import org.eclipse.jpt.core.context.IdClassReference; -import org.eclipse.jpt.core.context.MappedSuperclass; -import org.eclipse.jpt.core.context.java.JavaMappedSuperclass; -import org.eclipse.jpt.ui.WidgetFactory; -import org.eclipse.jpt.ui.details.JpaComposite; -import org.eclipse.jpt.ui.internal.details.AccessTypeComposite; -import org.eclipse.jpt.ui.internal.details.IdClassComposite; -import org.eclipse.jpt.ui.internal.details.java.BaseJavaUiFactory; -import org.eclipse.jpt.ui.internal.widgets.Pane; -import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter; -import org.eclipse.jpt.utility.model.value.PropertyValueModel; -import org.eclipse.swt.widgets.Composite; - -/** - * Here the layout of this pane: - * <pre> - * ----------------------------------------------------------------------------- - * | | - * | IdClassComposite | - * | | - * -----------------------------------------------------------------------------</pre> - * - * @see MappedSuperclass - * @see BaseJavaUiFactory - The factory creating this pane - * @see IdClassComposite - * - * @version 2.0 - * @since 2.0 - */ -public class JavaMappedSuperclass2_0Composite - extends Pane<JavaMappedSuperclass> - implements JpaComposite -{ - /** - * Creates a new <code>MappedSuperclassComposite</code>. - * - * @param subjectHolder The holder of this pane's subject - * @param parent The parent container - * @param widgetFactory The factory used to create various common widgets - */ - public JavaMappedSuperclass2_0Composite( - PropertyValueModel<? extends JavaMappedSuperclass> subjectHolder, - Composite parent, - WidgetFactory widgetFactory) { - - super(subjectHolder, parent, widgetFactory); - } - - - @Override - protected void initializeLayout(Composite container) { - new AccessTypeComposite(this, buildAccessHolder(), container); - new IdClassComposite(this, buildIdClassReferenceHolder(), container); - } - - protected PropertyValueModel<AccessHolder> buildAccessHolder() { - return new PropertyAspectAdapter<JavaMappedSuperclass, AccessHolder>(getSubjectHolder()) { - @Override - protected AccessHolder buildValue_() { - return this.subject.getPersistentType(); - } - }; - } - - protected PropertyValueModel<IdClassReference> buildIdClassReferenceHolder() { - return new PropertyAspectAdapter<MappedSuperclass, IdClassReference>(getSubjectHolder()) { - @Override - protected IdClassReference buildValue_() { - return this.subject.getIdClassReference(); - } - }; - } -}
\ No newline at end of file diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/java/JavaOneToManyMapping2_0Composite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/java/JavaOneToManyMapping2_0Composite.java deleted file mode 100644 index 93a4a47e82..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/java/JavaOneToManyMapping2_0Composite.java +++ /dev/null @@ -1,103 +0,0 @@ -/******************************************************************************* -* Copyright (c) 2009 Oracle. All rights reserved. -* This program and the accompanying materials are made available under the -* terms of the Eclipse Public License v1.0, which accompanies this distribution -* and is available at http://www.eclipse.org/legal/epl-v10.html. -* -* Contributors: -* Oracle - initial API and implementation -*******************************************************************************/ -package org.eclipse.jpt.ui.internal.jpa2.details.java; - -import org.eclipse.jpt.core.jpa2.context.OrphanRemovable2_0; -import org.eclipse.jpt.core.jpa2.context.OrphanRemovalHolder2_0; -import org.eclipse.jpt.core.jpa2.context.java.JavaOneToManyMapping2_0; -import org.eclipse.jpt.ui.WidgetFactory; -import org.eclipse.jpt.ui.internal.details.AbstractOneToManyMappingComposite; -import org.eclipse.jpt.ui.internal.details.CascadeComposite; -import org.eclipse.jpt.ui.internal.details.FetchTypeComposite; -import org.eclipse.jpt.ui.internal.details.OneToManyJoiningStrategyPane; -import org.eclipse.jpt.ui.internal.details.OrderingComposite; -import org.eclipse.jpt.ui.internal.details.TargetEntityComposite; -import org.eclipse.jpt.ui.internal.jpa2.details.Ordering2_0Composite; -import org.eclipse.jpt.ui.internal.jpa2.details.OrphanRemoval2_0Composite; -import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter; -import org.eclipse.jpt.utility.model.value.PropertyValueModel; -import org.eclipse.swt.widgets.Composite; - -/** - * Here the layout of this pane: - * <pre> - * ----------------------------------------------------------------------------- - * | ------------------------------------------------------------------------- | - * | | | | - * | | TargetEntityComposite | | - * | | | | - * | ------------------------------------------------------------------------- | - * | ------------------------------------------------------------------------- | - * | | | | - * | | OneToManyJoiningStrategyPane | | - * | | | | - * | ------------------------------------------------------------------------- | - * | ------------------------------------------------------------------------- | - * | | | | - * | | FetchTypeComposite | | - * | | | | - * | ------------------------------------------------------------------------- | - * | ------------------------------------------------------------------------- | - * | | | | - * | | CascadeComposite | | - * | | | | - * | ------------------------------------------------------------------------- | - * | ------------------------------------------------------------------------- | - * | | | | - * | | OrphanRemoval2_0Composite | | - * | | | | - * | ------------------------------------------------------------------------- | - * | ------------------------------------------------------------------------- | - * | | | | - * | | OrderingComposite | | - * | | | | - * | ------------------------------------------------------------------------- | - * -----------------------------------------------------------------------------</pre> - * - * @see {@link JavaOneToManyMapping2_0} - * @see {@link TargetEntityComposite} - * @see {@link OneToManyJoiningStrategyPane} - * @see {@link FetchTypeComposite} - * @see {@link CascadeComposite} - * @see {@link OrphanRemoval2_0Composite} - * @see {@link OrderingComposite} - */ -public class JavaOneToManyMapping2_0Composite<T extends JavaOneToManyMapping2_0> - extends AbstractOneToManyMappingComposite<T> -{ - public JavaOneToManyMapping2_0Composite( - PropertyValueModel<T> subjectHolder, - Composite parent, - WidgetFactory widgetFactory) { - - super(subjectHolder, parent, widgetFactory); - } - - @Override - protected void initializeLayout(Composite container) { - int groupBoxMargin = getGroupBoxMargin(); - - new TargetEntityComposite(this, this.addPane(container, groupBoxMargin)); - new OneToManyJoiningStrategyPane(this, this.buildJoiningHolder(), container); - new FetchTypeComposite(this, this.addPane(container, groupBoxMargin)); - new OrphanRemoval2_0Composite(this, this.buildOrphanRemovableHolder(), this.addPane(container, groupBoxMargin)); - new CascadeComposite(this, this.buildCascadeHolder(), this.addSubPane(container, 5)); - new Ordering2_0Composite(this, container); - } - - protected PropertyValueModel<OrphanRemovable2_0> buildOrphanRemovableHolder() { - return new PropertyAspectAdapter<JavaOneToManyMapping2_0, OrphanRemovable2_0>(this.getSubjectHolder()) { - @Override - protected OrphanRemovable2_0 buildValue_() { - return ((OrphanRemovalHolder2_0) this.subject).getOrphanRemoval(); - } - }; - } -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/java/JavaOneToOneMapping2_0Composite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/java/JavaOneToOneMapping2_0Composite.java deleted file mode 100644 index f1a8105a31..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/java/JavaOneToOneMapping2_0Composite.java +++ /dev/null @@ -1,112 +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.ui.internal.jpa2.details.java; - -import org.eclipse.jpt.core.jpa2.context.OrphanRemovable2_0; -import org.eclipse.jpt.core.jpa2.context.OrphanRemovalHolder2_0; -import org.eclipse.jpt.core.jpa2.context.java.JavaOneToOneMapping2_0; -import org.eclipse.jpt.ui.WidgetFactory; -import org.eclipse.jpt.ui.internal.details.CascadeComposite; -import org.eclipse.jpt.ui.internal.details.FetchTypeComposite; -import org.eclipse.jpt.ui.internal.details.OneToOneJoiningStrategyPane; -import org.eclipse.jpt.ui.internal.details.OptionalComposite; -import org.eclipse.jpt.ui.internal.details.TargetEntityComposite; -import org.eclipse.jpt.ui.internal.jpa2.details.AbstractOneToOneMapping2_0Composite; -import org.eclipse.jpt.ui.internal.jpa2.details.DerivedIdentity2_0Pane; -import org.eclipse.jpt.ui.internal.jpa2.details.OrphanRemoval2_0Composite; -import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter; -import org.eclipse.jpt.utility.model.value.PropertyValueModel; -import org.eclipse.swt.widgets.Composite; - -/** - * Here the layout of this pane: - * <pre> - * ----------------------------------------------------------------------------- - * | ------------------------------------------------------------------------- | - * | | | | - * | | TargetEntityComposite | | - * | | | | - * | ------------------------------------------------------------------------- | - * | ------------------------------------------------------------------------- | - * | | | | - * | | DerivedIdentity2_0Pane | | - * | | | | - * | ------------------------------------------------------------------------- | - * | ------------------------------------------------------------------------- | - * | | | | - * | | OneToOneJoiningStrategyPane | | - * | | | | - * | ------------------------------------------------------------------------- | - * | ------------------------------------------------------------------------- | - * | | | | - * | | FetchTypeComposite | | - * | | | | - * | ------------------------------------------------------------------------- | - * | ------------------------------------------------------------------------- | - * | | | | - * | | OptionalComposite | | - * | | | | - * | ------------------------------------------------------------------------- | - * | ------------------------------------------------------------------------- | - * | | | | - * | | CascadeComposite | | - * | | | | - * | ------------------------------------------------------------------------- | - * | ------------------------------------------------------------------------- | - * | | | | - * | | OrphanRemoval2_0Composite | | - * | | | | - * | ------------------------------------------------------------------------- | - * -----------------------------------------------------------------------------</pre> - * - * @see {@link JavaOneToOneMapping2_0} - * @see {@link TargetEntityComposite} - * @see {@link DerivedId2_0Pane} - * @see {@link OneToOneJoiningStrategyPane} - * @see {@link FetchTypeComposite} - * @see {@link OptionalComposite} - * @see {@link CascadeComposite} - * @see {@link OrphanRemoval2_0Composite} - */ -public class JavaOneToOneMapping2_0Composite<T extends JavaOneToOneMapping2_0> - extends AbstractOneToOneMapping2_0Composite<T> -{ - public JavaOneToOneMapping2_0Composite( - PropertyValueModel<? extends T> subjectHolder, - Composite parent, - WidgetFactory widgetFactory) { - - super(subjectHolder, parent, widgetFactory); - } - - - @Override - protected void initializeLayout(Composite container) { - int groupBoxMargin = getGroupBoxMargin(); - - new TargetEntityComposite(this, addPane(container, groupBoxMargin)); - new DerivedIdentity2_0Pane(this, buildDerivedIdentityHolder(), container); - new OneToOneJoiningStrategyPane(this, buildJoiningHolder(), container); - new FetchTypeComposite(this, addPane(container, groupBoxMargin)); - new OptionalComposite(this, addPane(container, groupBoxMargin)); - new OrphanRemoval2_0Composite(this, buildOrphanRemovableHolder(), addPane(container, groupBoxMargin)); - new CascadeComposite(this, buildCascadeHolder(), addSubPane(container, 5)); - } - - protected PropertyValueModel<OrphanRemovable2_0> buildOrphanRemovableHolder() { - return new PropertyAspectAdapter<JavaOneToOneMapping2_0, OrphanRemovable2_0>(getSubjectHolder()) { - @Override - protected OrphanRemovable2_0 buildValue_() { - return ((OrphanRemovalHolder2_0) this.subject).getOrphanRemoval(); - } - }; - } -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/orm/EntityMappings2_0DetailsPage.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/orm/EntityMappings2_0DetailsPage.java deleted file mode 100644 index 647e66236b..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/orm/EntityMappings2_0DetailsPage.java +++ /dev/null @@ -1,46 +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.ui.internal.jpa2.details.orm; - -import org.eclipse.jpt.ui.WidgetFactory; -import org.eclipse.jpt.ui.internal.details.orm.AbstractEntityMappingsDetailsPage; -import org.eclipse.swt.widgets.Composite; - -/** - * EntityMappings2_0DetailsPage - */ -public class EntityMappings2_0DetailsPage extends AbstractEntityMappingsDetailsPage -{ - /** - * Creates a new <code>EntityMappings2_0DetailsPage</code>. - * - * @param parent The parent container - * @param widgetFactory The factory used to create various common widgets - */ - public EntityMappings2_0DetailsPage(Composite parent, - WidgetFactory widgetFactory) { - - super(parent, widgetFactory); - } - - @Override - protected void buildEntityMappingsGeneratorsComposite(Composite container) { - new EntityMappingsGenerators2_0Composite( - this, - container - ); - } - - @Override - protected void buildOrmQueriesComposite(Composite container) { - new OrmQueries2_0Composite(this, container); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/orm/EntityMappings2_0DetailsProvider.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/orm/EntityMappings2_0DetailsProvider.java deleted file mode 100644 index 89b9d0b7db..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/orm/EntityMappings2_0DetailsProvider.java +++ /dev/null @@ -1,58 +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.ui.internal.jpa2.details.orm; - -import org.eclipse.jpt.core.JpaResourceType; -import org.eclipse.jpt.core.JptCorePlugin; -import org.eclipse.jpt.core.context.orm.EntityMappings; -import org.eclipse.jpt.ui.WidgetFactory; -import org.eclipse.jpt.ui.details.JpaDetailsPage; -import org.eclipse.jpt.ui.details.JpaDetailsProvider; -import org.eclipse.jpt.ui.internal.details.AbstractEntityMappingsDetailsProvider; -import org.eclipse.swt.widgets.Composite; - -/** - * EntityMappings2_0DetailsProvider - */ -public class EntityMappings2_0DetailsProvider - extends AbstractEntityMappingsDetailsProvider -{ - // singleton - private static final JpaDetailsProvider INSTANCE = new EntityMappings2_0DetailsProvider(); - - - /** - * Return the singleton - */ - public static JpaDetailsProvider instance() { - return INSTANCE; - } - - - /** - * Enforce singleton usage - */ - private EntityMappings2_0DetailsProvider() { - super(); - } - - - @Override - protected boolean providesDetails(JpaResourceType resourceType) { - return resourceType.equals(JptCorePlugin.ORM_XML_2_0_RESOURCE_TYPE); - } - - public JpaDetailsPage<EntityMappings> buildDetailsPage( - Composite parent, - WidgetFactory widgetFactory) { - - return new EntityMappings2_0DetailsPage(parent, widgetFactory); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/orm/EntityMappingsGenerators2_0Composite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/orm/EntityMappingsGenerators2_0Composite.java deleted file mode 100644 index ecf89b66b1..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/orm/EntityMappingsGenerators2_0Composite.java +++ /dev/null @@ -1,53 +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.ui.internal.jpa2.details.orm; - -import org.eclipse.jpt.core.context.SequenceGenerator; -import org.eclipse.jpt.core.context.orm.EntityMappings; -import org.eclipse.jpt.ui.internal.details.GeneratorComposite; -import org.eclipse.jpt.ui.internal.details.GeneratorComposite.GeneratorBuilder; -import org.eclipse.jpt.ui.internal.details.orm.EntityMappingsGeneratorsComposite; -import org.eclipse.jpt.ui.internal.jpa2.details.SequenceGenerator2_0Composite; -import org.eclipse.jpt.ui.internal.widgets.Pane; -import org.eclipse.jpt.utility.model.value.PropertyValueModel; -import org.eclipse.swt.widgets.Composite; - -/** - * EntityMappingsGenerators2_0Composite - */ -public class EntityMappingsGenerators2_0Composite extends EntityMappingsGeneratorsComposite -{ - /** - * Creates a new <code>EntityMappingsGenerators2_0Composite</code>. - * - * @param parentPane The parent container of this one - * @param parent The parent container - */ - public EntityMappingsGenerators2_0Composite( - Pane<? extends EntityMappings> parentPane, - Composite parent) { - - super(parentPane, parent); - } - - @Override - protected GeneratorComposite<SequenceGenerator> buildSequenceGeneratorComposite( - Composite parent, - PropertyValueModel<SequenceGenerator> sequenceGeneratorHolder, - GeneratorBuilder<SequenceGenerator> generatorBuilder) { - - return new SequenceGenerator2_0Composite( - this, - sequenceGeneratorHolder, - parent, - generatorBuilder - ); - } -}
\ No newline at end of file diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/orm/OrmBasicMapping2_0Composite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/orm/OrmBasicMapping2_0Composite.java deleted file mode 100644 index eed8aa40c2..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/orm/OrmBasicMapping2_0Composite.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.ui.internal.jpa2.details.orm; - -import org.eclipse.jpt.core.context.AccessHolder; -import org.eclipse.jpt.core.context.orm.OrmBasicMapping; -import org.eclipse.jpt.ui.WidgetFactory; -import org.eclipse.jpt.ui.internal.details.AbstractBasicMappingComposite; -import org.eclipse.jpt.ui.internal.details.AccessTypeComposite; -import org.eclipse.jpt.ui.internal.details.ColumnComposite; -import org.eclipse.jpt.ui.internal.details.FetchTypeComposite; -import org.eclipse.jpt.ui.internal.details.OptionalComposite; -import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter; -import org.eclipse.jpt.utility.model.value.PropertyValueModel; -import org.eclipse.swt.widgets.Composite; - -public class OrmBasicMapping2_0Composite extends AbstractBasicMappingComposite<OrmBasicMapping> -{ - /** - * 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 OrmBasicMapping2_0Composite(PropertyValueModel<? extends OrmBasicMapping> subjectHolder, - Composite parent, - WidgetFactory widgetFactory) { - - super(subjectHolder, parent, widgetFactory); - } - - @Override - protected void initializeGeneralPane(Composite container) { - int groupBoxMargin = getGroupBoxMargin(); - - new ColumnComposite(this, buildColumnHolder(), container); - new AccessTypeComposite(this, buildAccessHolderHolder(), container); - - // Align the widgets under the ColumnComposite - container = addSubPane(container, 0, groupBoxMargin, 0, groupBoxMargin); - - new FetchTypeComposite(this, container); - new OptionalComposite(this, addSubPane(container, 4)); - } - - protected PropertyValueModel<AccessHolder> buildAccessHolderHolder() { - return new PropertyAspectAdapter<OrmBasicMapping, AccessHolder>(getSubjectHolder()) { - @Override - protected AccessHolder buildValue_() { - return this.subject.getPersistentAttribute(); - } - }; - } -}
\ No newline at end of file diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/orm/OrmElementCollectionMapping2_0Composite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/orm/OrmElementCollectionMapping2_0Composite.java deleted file mode 100644 index a7c6c8df87..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/orm/OrmElementCollectionMapping2_0Composite.java +++ /dev/null @@ -1,57 +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.ui.internal.jpa2.details.orm; - -import org.eclipse.jpt.core.context.AccessHolder; -import org.eclipse.jpt.core.jpa2.context.orm.OrmElementCollectionMapping2_0; -import org.eclipse.jpt.ui.WidgetFactory; -import org.eclipse.jpt.ui.internal.details.AccessTypeComposite; -import org.eclipse.jpt.ui.internal.details.FetchTypeComposite; -import org.eclipse.jpt.ui.internal.jpa2.details.AbstractElementCollectionMapping2_0Composite; -import org.eclipse.jpt.ui.internal.jpa2.details.CollectionTable2_0Composite; -import org.eclipse.jpt.ui.internal.jpa2.details.TargetClassComposite; -import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter; -import org.eclipse.jpt.utility.model.value.PropertyValueModel; -import org.eclipse.swt.widgets.Composite; - -public class OrmElementCollectionMapping2_0Composite extends AbstractElementCollectionMapping2_0Composite<OrmElementCollectionMapping2_0> -{ - /** - * 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 OrmElementCollectionMapping2_0Composite(PropertyValueModel<? extends OrmElementCollectionMapping2_0> subjectHolder, - Composite parent, - WidgetFactory widgetFactory) { - - super(subjectHolder, parent, widgetFactory); - } - - @Override - protected void initializeGeneralPane(Composite container) { - int groupBoxMargin = this.getGroupBoxMargin(); - new TargetClassComposite(this, this.addPane(container, groupBoxMargin)); - new AccessTypeComposite(this, buildAccessHolderHolder(), this.addPane(container, groupBoxMargin)); - new FetchTypeComposite(this, this.addPane(container, groupBoxMargin)); - new CollectionTable2_0Composite(this, buildCollectionTableHolder(), container); - } - - protected PropertyValueModel<AccessHolder> buildAccessHolderHolder() { - return new PropertyAspectAdapter<OrmElementCollectionMapping2_0, AccessHolder>(getSubjectHolder()) { - @Override - protected AccessHolder buildValue_() { - return this.subject.getPersistentAttribute(); - } - }; - } -}
\ No newline at end of file diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/orm/OrmElementCollectionMapping2_0UiDefinition.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/orm/OrmElementCollectionMapping2_0UiDefinition.java deleted file mode 100644 index ab1b8be86c..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/orm/OrmElementCollectionMapping2_0UiDefinition.java +++ /dev/null @@ -1,53 +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.ui.internal.jpa2.details.orm; - -import org.eclipse.jpt.core.jpa2.context.orm.OrmElementCollectionMapping2_0; -import org.eclipse.jpt.ui.WidgetFactory; -import org.eclipse.jpt.ui.details.JpaComposite; -import org.eclipse.jpt.ui.details.orm.OrmAttributeMappingUiDefinition; -import org.eclipse.jpt.ui.details.orm.OrmXmlUiFactory; -import org.eclipse.jpt.ui.internal.jpa2.details.AbstractElementCollectionMapping2_0UiDefinition; -import org.eclipse.jpt.ui.jpa2.details.orm.OrmXmlUiFactory2_0; -import org.eclipse.jpt.utility.model.value.PropertyValueModel; -import org.eclipse.swt.widgets.Composite; - -public class OrmElementCollectionMapping2_0UiDefinition - extends AbstractElementCollectionMapping2_0UiDefinition<OrmElementCollectionMapping2_0> - implements OrmAttributeMappingUiDefinition<OrmElementCollectionMapping2_0> -{ - // singleton - private static final OrmElementCollectionMapping2_0UiDefinition INSTANCE = - new OrmElementCollectionMapping2_0UiDefinition(); - - /** - * Return the singleton. - */ - public static OrmAttributeMappingUiDefinition<OrmElementCollectionMapping2_0> instance() { - return INSTANCE; - } - - - /** - * Ensure single instance. - */ - private OrmElementCollectionMapping2_0UiDefinition() { - super(); - } - - public JpaComposite buildAttributeMappingComposite( - OrmXmlUiFactory factory, - PropertyValueModel<OrmElementCollectionMapping2_0> subjectHolder, - Composite parent, - WidgetFactory widgetFactory) { - return ((OrmXmlUiFactory2_0) factory).createOrmElementCollectionMapping2_0Composite(subjectHolder, parent, widgetFactory); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/orm/OrmEmbeddedIdMapping2_0Composite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/orm/OrmEmbeddedIdMapping2_0Composite.java deleted file mode 100644 index a34f3130ef..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/orm/OrmEmbeddedIdMapping2_0Composite.java +++ /dev/null @@ -1,75 +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.ui.internal.jpa2.details.orm; - -import org.eclipse.jpt.core.context.AccessHolder; -import org.eclipse.jpt.core.context.orm.OrmEmbeddedIdMapping; -import org.eclipse.jpt.ui.WidgetFactory; -import org.eclipse.jpt.ui.details.JpaComposite; -import org.eclipse.jpt.ui.internal.details.AccessTypeComposite; -import org.eclipse.jpt.ui.internal.details.EmbeddedMappingOverridesComposite; -import org.eclipse.jpt.ui.internal.widgets.Pane; -import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter; -import org.eclipse.jpt.utility.model.value.PropertyValueModel; -import org.eclipse.swt.widgets.Composite; - -/** - * Here's the layout of this pane: - * <pre> - * ----------------------------------------------------------------------------- - * | ------------------------------------------------------------------------- | - * | | | | - * | | EmbeddedAttributeOverridesComposite | | - * | | | | - * | ------------------------------------------------------------------------- | - * -----------------------------------------------------------------------------</pre> - * - * @see EmbeddedIdMapping - * @see BaseJavaUiFactory - The factory creating this pane - * - * @version 2.2 - * @since 2.2 - */ -public class OrmEmbeddedIdMapping2_0Composite extends Pane<OrmEmbeddedIdMapping> - implements JpaComposite -{ - /** - * Creates a new <code>EclipseLink1_1OrmEmbeddedIdMappingComposite</code>. - * - * @param subjectHolder The holder of the subject <code>EmbeddedIdMapping</code> - * @param parent The parent container - * @param widgetFactory The factory used to create various common widgets - */ - public OrmEmbeddedIdMapping2_0Composite(PropertyValueModel<? extends OrmEmbeddedIdMapping> subjectHolder, - Composite parent, - WidgetFactory widgetFactory) { - - super(subjectHolder, parent, widgetFactory); - } - - @Override - protected void initializeLayout(Composite container) { - new AccessTypeComposite(this, buildAccessHolderHolder(), container); - - new EmbeddedMappingOverridesComposite( - this, - container - ); - } - - protected PropertyValueModel<AccessHolder> buildAccessHolderHolder() { - return new PropertyAspectAdapter<OrmEmbeddedIdMapping, AccessHolder>(getSubjectHolder()) { - @Override - protected AccessHolder buildValue_() { - return this.subject.getPersistentAttribute(); - } - }; - } -}
\ No newline at end of file diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/orm/OrmEmbeddedMapping2_0Composite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/orm/OrmEmbeddedMapping2_0Composite.java deleted file mode 100644 index 0167ba522d..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/orm/OrmEmbeddedMapping2_0Composite.java +++ /dev/null @@ -1,76 +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.ui.internal.jpa2.details.orm; - -import org.eclipse.jpt.core.context.AccessHolder; -import org.eclipse.jpt.core.context.orm.OrmEmbeddedMapping; -import org.eclipse.jpt.ui.WidgetFactory; -import org.eclipse.jpt.ui.details.JpaComposite; -import org.eclipse.jpt.ui.internal.details.AccessTypeComposite; -import org.eclipse.jpt.ui.internal.jpa2.details.EmbeddedMapping2_0OverridesComposite; -import org.eclipse.jpt.ui.internal.widgets.Pane; -import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter; -import org.eclipse.jpt.utility.model.value.PropertyValueModel; -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.2 - * @since 2.2 - */ -public class OrmEmbeddedMapping2_0Composite extends Pane<OrmEmbeddedMapping> - implements JpaComposite -{ - /** - * 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 OrmEmbeddedMapping2_0Composite(PropertyValueModel<? extends OrmEmbeddedMapping> subjectHolder, - Composite parent, - WidgetFactory widgetFactory) { - - super(subjectHolder, parent, widgetFactory); - } - - - @Override - protected void initializeLayout(Composite container) { - new AccessTypeComposite(this, buildAccessHolderHolder(), container); - - new EmbeddedMapping2_0OverridesComposite( - this, - container - ); - } - - protected PropertyValueModel<AccessHolder> buildAccessHolderHolder() { - return new PropertyAspectAdapter<OrmEmbeddedMapping, AccessHolder>(getSubjectHolder()) { - @Override - protected AccessHolder buildValue_() { - return this.subject.getPersistentAttribute(); - } - }; - } -}
\ No newline at end of file diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/orm/OrmEntity2_0Composite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/orm/OrmEntity2_0Composite.java deleted file mode 100644 index 50df55deeb..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/orm/OrmEntity2_0Composite.java +++ /dev/null @@ -1,100 +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.ui.internal.jpa2.details.orm; - -import org.eclipse.jpt.core.context.GeneratorContainer; -import org.eclipse.jpt.core.context.QueryContainer; -import org.eclipse.jpt.core.context.orm.OrmEntity; -import org.eclipse.jpt.core.jpa2.context.Cacheable2_0; -import org.eclipse.jpt.core.jpa2.context.CacheableHolder2_0; -import org.eclipse.jpt.ui.WidgetFactory; -import org.eclipse.jpt.ui.internal.details.AccessTypeComposite; -import org.eclipse.jpt.ui.internal.details.EntityNameComposite; -import org.eclipse.jpt.ui.internal.details.IdClassComposite; -import org.eclipse.jpt.ui.internal.details.TableComposite; -import org.eclipse.jpt.ui.internal.details.orm.AbstractOrmEntityComposite; -import org.eclipse.jpt.ui.internal.details.orm.MetadataCompleteComposite; -import org.eclipse.jpt.ui.internal.details.orm.OrmJavaClassChooser; -import org.eclipse.jpt.ui.internal.jpa2.details.Cacheable2_0Pane; -import org.eclipse.jpt.ui.internal.jpa2.details.Entity2_0OverridesComposite; -import org.eclipse.jpt.ui.internal.jpa2.details.Generation2_0Composite; -import org.eclipse.jpt.ui.internal.jpa2.details.Queries2_0Composite; -import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter; -import org.eclipse.jpt.utility.model.value.PropertyValueModel; -import org.eclipse.swt.widgets.Composite; - -/** - * The pane used for an ORM entity 2.0. - * - * @see OrmEntity - * @see Entity2_0OverridesComposite - */ -public class OrmEntity2_0Composite - 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 OrmEntity2_0Composite( - PropertyValueModel<? extends OrmEntity> subjectHolder, - Composite parent, - WidgetFactory widgetFactory) { - - super(subjectHolder, parent, widgetFactory); - } - - - @Override - protected void initializeGeneralPane(Composite container) { - int groupBoxMargin = getGroupBoxMargin(); - - new OrmJavaClassChooser( - this, getSubjectHolder(), addSubPane(container, 0, groupBoxMargin, 0, groupBoxMargin), false); - new TableComposite(this, container); - new EntityNameComposite( - this, addSubPane(container, 0, groupBoxMargin, 0, groupBoxMargin)); - new AccessTypeComposite( - this, buildAccessHolder(), addSubPane(container, 0, groupBoxMargin, 0, groupBoxMargin)); - new IdClassComposite( - this, buildIdClassReferenceHolder(), addSubPane(container, 0, groupBoxMargin, 0, groupBoxMargin), false); - new Cacheable2_0Pane( - this, buildCacheableHolder(), addSubPane(container, 0, groupBoxMargin, 0, groupBoxMargin)); - new MetadataCompleteComposite( - this, getSubjectHolder(), addSubPane(container, 0, groupBoxMargin, 0, groupBoxMargin)); - } - - protected PropertyValueModel<Cacheable2_0> buildCacheableHolder() { - return new PropertyAspectAdapter<OrmEntity, Cacheable2_0>(getSubjectHolder()) { - @Override - protected Cacheable2_0 buildValue_() { - return ((CacheableHolder2_0) this.subject).getCacheable(); - } - }; - } - - @Override - protected void addAttributeOverridesComposite(Composite container) { - new Entity2_0OverridesComposite(this, container); - } - - @Override - protected void addGeneratorsComposite(Composite container, PropertyValueModel<GeneratorContainer> generatorContainerHolder) { - new Generation2_0Composite(this, generatorContainerHolder, container); - } - - @Override - protected void addQueriesComposite(Composite container, PropertyValueModel<QueryContainer> queryContainerHolder) { - new Queries2_0Composite(this, queryContainerHolder, container); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/orm/OrmIdMapping2_0Composite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/orm/OrmIdMapping2_0Composite.java deleted file mode 100644 index 3aceb546ee..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/orm/OrmIdMapping2_0Composite.java +++ /dev/null @@ -1,53 +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.ui.internal.jpa2.details.orm; - -import org.eclipse.jpt.core.context.AccessHolder; -import org.eclipse.jpt.core.context.orm.OrmIdMapping; -import org.eclipse.jpt.ui.WidgetFactory; -import org.eclipse.jpt.ui.internal.details.AbstractIdMappingComposite; -import org.eclipse.jpt.ui.internal.details.AccessTypeComposite; -import org.eclipse.jpt.ui.internal.details.ColumnComposite; -import org.eclipse.jpt.ui.internal.jpa2.details.IdMappingGeneration2_0Composite; -import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter; -import org.eclipse.jpt.utility.model.value.PropertyValueModel; -import org.eclipse.swt.widgets.Composite; - -public class OrmIdMapping2_0Composite extends AbstractIdMappingComposite<OrmIdMapping> -{ - public OrmIdMapping2_0Composite(PropertyValueModel<? extends OrmIdMapping> subjectHolder, - Composite parent, - WidgetFactory widgetFactory) { - - super(subjectHolder, parent, widgetFactory); - } - - @Override - protected void initializeLayout(Composite container) { - - // Column widgets - new ColumnComposite(this, buildColumnHolder(), container); - new AccessTypeComposite(this, buildAccessHolderHolder(), container); - - initializeTypePane(container); - - // Generation pane - new IdMappingGeneration2_0Composite(this, addSubPane(container, 10)); - } - - protected PropertyValueModel<AccessHolder> buildAccessHolderHolder() { - return new PropertyAspectAdapter<OrmIdMapping, AccessHolder>(getSubjectHolder()) { - @Override - protected AccessHolder buildValue_() { - return this.subject.getPersistentAttribute(); - } - }; - } -}
\ No newline at end of file diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/orm/OrmManyToManyMapping2_0Composite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/orm/OrmManyToManyMapping2_0Composite.java deleted file mode 100644 index 9ac93dc3f8..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/orm/OrmManyToManyMapping2_0Composite.java +++ /dev/null @@ -1,95 +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.ui.internal.jpa2.details.orm; - -import org.eclipse.jpt.core.context.ManyToManyMapping; -import org.eclipse.jpt.core.context.orm.OrmManyToManyMapping; -import org.eclipse.jpt.ui.WidgetFactory; -import org.eclipse.jpt.ui.internal.details.AbstractManyToManyMappingComposite; -import org.eclipse.jpt.ui.internal.details.AccessTypeComposite; -import org.eclipse.jpt.ui.internal.details.CascadeComposite; -import org.eclipse.jpt.ui.internal.details.FetchTypeComposite; -import org.eclipse.jpt.ui.internal.details.ManyToManyJoiningStrategyPane; -import org.eclipse.jpt.ui.internal.details.OrderingComposite; -import org.eclipse.jpt.ui.internal.details.TargetEntityComposite; -import org.eclipse.jpt.ui.internal.jpa2.details.Ordering2_0Composite; -import org.eclipse.jpt.utility.model.value.PropertyValueModel; -import org.eclipse.swt.widgets.Composite; - -/** - * Here the layout of this pane: - * <pre> - * ----------------------------------------------------------------------------- - * | ------------------------------------------------------------------------- | - * | | | | - * | | TargetEntityComposite | | - * | | | | - * | ------------------------------------------------------------------------- | - * | ------------------------------------------------------------------------- | - * | | | | - * | | JoiningStrategyComposite | | - * | | | | - * | ------------------------------------------------------------------------- | - * | ------------------------------------------------------------------------- | - * | | | | - * | | FetchTypeComposite | | - * | | | | - * | ------------------------------------------------------------------------- | - * | ------------------------------------------------------------------------- | - * | | | | - * | | CascadeComposite | | - * | | | | - * | ------------------------------------------------------------------------- | - * | ------------------------------------------------------------------------- | - * | | | | - * | | OrderingComposite | | - * | | | | - * | ------------------------------------------------------------------------- | - * -----------------------------------------------------------------------------</pre> - * - * @see {@link ManyToManyMapping} - * @see {@link BaseJavaUiFactory} - The factory creating this pane - * @see {@link TargetEntityComposite} - * @see {@link ManyToManyJoiningStrategyPane} - * @see {@link FetchTypeComposite} - * @see {@link CascadeComposite} - * @see {@link OrderingComposite} - * - * @version 2.2 - * @since 2.2 - */ -public class OrmManyToManyMapping2_0Composite extends AbstractManyToManyMappingComposite<OrmManyToManyMapping> -{ - /** - * Creates a new <code>ManyToManyMappingComposite</code>. - * - * @param subjectHolder The holder of the subject <code>IManyToManyMapping</code> - * @param parent The parent container - * @param widgetFactory The factory used to create various common widgets - */ - public OrmManyToManyMapping2_0Composite(PropertyValueModel<? extends OrmManyToManyMapping> subjectHolder, - Composite parent, - WidgetFactory widgetFactory) { - - super(subjectHolder, parent, widgetFactory); - } - - @Override - protected void initializeLayout(Composite container) { - int groupBoxMargin = getGroupBoxMargin(); - - new TargetEntityComposite(this, addPane(container, groupBoxMargin)); - new ManyToManyJoiningStrategyPane(this, buildJoiningHolder(), container); - new AccessTypeComposite(this, buildAccessHolderHolder(), addPane(container, groupBoxMargin)); - new FetchTypeComposite(this, addPane(container, groupBoxMargin)); - new CascadeComposite(this, buildCascadeHolder(), addSubPane(container, 5)); - new Ordering2_0Composite(this, container); - } -}
\ No newline at end of file diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/orm/OrmManyToOneMapping2_0Composite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/orm/OrmManyToOneMapping2_0Composite.java deleted file mode 100644 index 199d6ffdca..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/orm/OrmManyToOneMapping2_0Composite.java +++ /dev/null @@ -1,112 +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.ui.internal.jpa2.details.orm; - -import org.eclipse.jpt.core.context.AccessHolder; -import org.eclipse.jpt.core.context.orm.OrmManyToOneMapping; -import org.eclipse.jpt.core.jpa2.context.orm.OrmManyToOneMapping2_0; -import org.eclipse.jpt.ui.WidgetFactory; -import org.eclipse.jpt.ui.internal.details.AccessTypeComposite; -import org.eclipse.jpt.ui.internal.details.CascadeComposite; -import org.eclipse.jpt.ui.internal.details.FetchTypeComposite; -import org.eclipse.jpt.ui.internal.details.ManyToOneJoiningStrategyPane; -import org.eclipse.jpt.ui.internal.details.OptionalComposite; -import org.eclipse.jpt.ui.internal.details.TargetEntityComposite; -import org.eclipse.jpt.ui.internal.jpa2.details.AbstractManyToOneMapping2_0Composite; -import org.eclipse.jpt.ui.internal.jpa2.details.DerivedIdentity2_0Pane; -import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter; -import org.eclipse.jpt.utility.model.value.PropertyValueModel; -import org.eclipse.swt.widgets.Composite; - -/** - * Here the layout of this pane: - * <pre> - * ----------------------------------------------------------------------------- - * | ------------------------------------------------------------------------- | - * | | | | - * | | TargetEntityComposite | | - * | | | | - * | ------------------------------------------------------------------------- | - * | ------------------------------------------------------------------------- | - * | | | | - * | | DerivedIdentity2_0Pane | | - * | | | | - * | ------------------------------------------------------------------------- | - * | ------------------------------------------------------------------------- | - * | | | | - * | | ManyToOneJoiningStrategyPane | | - * | | | | - * | ------------------------------------------------------------------------- | - * | ------------------------------------------------------------------------- | - * | | | | - * | | AccessTypeComposite | | - * | | | | - * | ------------------------------------------------------------------------- | - * | ------------------------------------------------------------------------- | - * | | | | - * | | FetchTypeComposite | | - * | | | | - * | ------------------------------------------------------------------------- | - * | ------------------------------------------------------------------------- | - * | | | | - * | | OptionalComposite | | - * | | | | - * | ------------------------------------------------------------------------- | - * | ------------------------------------------------------------------------- | - * | | | | - * | | CascadeComposite | | - * | | | | - * | ------------------------------------------------------------------------- | - * -----------------------------------------------------------------------------</pre> - * - * @see {@link OrmManyToOneMapping2_0} - * @see {@link OrmManyToOneMapping2_0UiProvider} - * @see {@link TargetEntityComposite} - * @see {@link DerivedId2_0Pane} - * @see {@link ManyToOneJoiningStrategyPane} - * @see {@link AccessTypeComposite} - * @see {@link FetchTypeComposite} - * @see {@link OptionalComposite} - * @see {@link CascadeComposite} - */ -public class OrmManyToOneMapping2_0Composite<T extends OrmManyToOneMapping2_0> - extends AbstractManyToOneMapping2_0Composite<T> -{ - public OrmManyToOneMapping2_0Composite( - PropertyValueModel<? extends T> subjectHolder, - Composite parent, - WidgetFactory widgetFactory) { - - super(subjectHolder, parent, widgetFactory); - } - - - @Override - protected void initializeLayout(Composite container) { - int groupBoxMargin = getGroupBoxMargin(); - - new TargetEntityComposite(this, addPane(container, groupBoxMargin)); - new DerivedIdentity2_0Pane(this, buildDerivedIdentityHolder(), container); - new ManyToOneJoiningStrategyPane(this, buildJoiningHolder(), container); - new AccessTypeComposite(this, buildAccessHolderHolder(), addPane(container, groupBoxMargin)); - new FetchTypeComposite(this, addPane(container, groupBoxMargin)); - new OptionalComposite(this, addPane(container, groupBoxMargin)); - new CascadeComposite(this, buildCascadeHolder(), addSubPane(container, 5)); - } - - protected PropertyValueModel<AccessHolder> buildAccessHolderHolder() { - return new PropertyAspectAdapter<OrmManyToOneMapping, AccessHolder>(getSubjectHolder()) { - @Override - protected AccessHolder buildValue_() { - return this.subject.getPersistentAttribute(); - } - }; - } -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/orm/OrmOneToManyMapping2_0Composite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/orm/OrmOneToManyMapping2_0Composite.java deleted file mode 100644 index 53c217072e..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/orm/OrmOneToManyMapping2_0Composite.java +++ /dev/null @@ -1,122 +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.ui.internal.jpa2.details.orm; - -import org.eclipse.jpt.core.context.AccessHolder; -import org.eclipse.jpt.core.context.OneToManyMapping; -import org.eclipse.jpt.core.context.orm.OrmOneToManyMapping; -import org.eclipse.jpt.core.jpa2.context.OrphanRemovable2_0; -import org.eclipse.jpt.core.jpa2.context.OrphanRemovalHolder2_0; -import org.eclipse.jpt.core.jpa2.context.orm.OrmOneToManyMapping2_0; -import org.eclipse.jpt.ui.WidgetFactory; -import org.eclipse.jpt.ui.internal.details.AbstractOneToManyMappingComposite; -import org.eclipse.jpt.ui.internal.details.AccessTypeComposite; -import org.eclipse.jpt.ui.internal.details.CascadeComposite; -import org.eclipse.jpt.ui.internal.details.FetchTypeComposite; -import org.eclipse.jpt.ui.internal.details.OneToManyJoiningStrategyPane; -import org.eclipse.jpt.ui.internal.details.OrderingComposite; -import org.eclipse.jpt.ui.internal.details.TargetEntityComposite; -import org.eclipse.jpt.ui.internal.jpa2.details.Ordering2_0Composite; -import org.eclipse.jpt.ui.internal.jpa2.details.OrphanRemoval2_0Composite; -import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter; -import org.eclipse.jpt.utility.model.value.PropertyValueModel; -import org.eclipse.swt.widgets.Composite; - -/** - * Here the layout of this pane: - * <pre> - * ----------------------------------------------------------------------------- - * | ------------------------------------------------------------------------- | - * | | | | - * | | TargetEntityComposite | | - * | | | | - * | ------------------------------------------------------------------------- | - * | ------------------------------------------------------------------------- | - * | | | | - * | | OneToManyJoiningStrategyPane | | - * | | | | - * | ------------------------------------------------------------------------- | - * | ------------------------------------------------------------------------- | - * | | | | - * | | AccessTypeComposite | | - * | | | | - * | ------------------------------------------------------------------------- | - * | ------------------------------------------------------------------------- | - * | | | | - * | | FetchTypeComposite | | - * | | | | - * | ------------------------------------------------------------------------- | - * | ------------------------------------------------------------------------- | - * | | | | - * | | CascadeComposite | | - * | | | | - * | ------------------------------------------------------------------------- | - * | ------------------------------------------------------------------------- | - * | | | | - * | | OrphanRemoval2_0Composite | | - * | | | | - * | ------------------------------------------------------------------------- | - * | ------------------------------------------------------------------------- | - * | | | | - * | | OrderingComposite | | - * | | | | - * | ------------------------------------------------------------------------- | - * -----------------------------------------------------------------------------</pre> - * - * @see OneToManyMapping - * @see TargetEntityComposite - * @see OneToManyJoiningStrategyPane - * @see AccessTypeComposite - * @see FetchTypeComposite - * @see CascadeComposite - * @see OrphanRemoval2_0Composite - * @see OrderingComposite - */ -public class OrmOneToManyMapping2_0Composite<T extends OrmOneToManyMapping2_0> - extends AbstractOneToManyMappingComposite<T> -{ - public OrmOneToManyMapping2_0Composite( - PropertyValueModel<T> subjectHolder, - Composite parent, - WidgetFactory widgetFactory) { - super(subjectHolder, parent, widgetFactory); - } - - @Override - protected void initializeLayout(Composite container) { - int groupBoxMargin = getGroupBoxMargin(); - - new TargetEntityComposite(this, this.addPane(container, groupBoxMargin)); - new OneToManyJoiningStrategyPane(this, this.buildJoiningHolder(), container); - new AccessTypeComposite(this, this.buildAccessHolderHolder(), this.addPane(container, groupBoxMargin)); - new FetchTypeComposite(this, this.addPane(container, groupBoxMargin)); - new OrphanRemoval2_0Composite(this, this.buildOrphanRemovableHolder(), this.addPane(container, groupBoxMargin)); - new CascadeComposite(this, this.buildCascadeHolder(), this.addSubPane(container, 5)); - new Ordering2_0Composite(this, container); - } - - protected PropertyValueModel<AccessHolder> buildAccessHolderHolder() { - return new PropertyAspectAdapter<OrmOneToManyMapping, AccessHolder>(this.getSubjectHolder()) { - @Override - protected AccessHolder buildValue_() { - return this.subject.getPersistentAttribute(); - } - }; - } - - protected PropertyValueModel<OrphanRemovable2_0> buildOrphanRemovableHolder() { - return new PropertyAspectAdapter<T, OrphanRemovable2_0>(this.getSubjectHolder()) { - @Override - protected OrphanRemovable2_0 buildValue_() { - return ((OrphanRemovalHolder2_0) this.subject).getOrphanRemoval(); - } - }; - } -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/orm/OrmOneToOneMapping2_0Composite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/orm/OrmOneToOneMapping2_0Composite.java deleted file mode 100644 index fc51b24bf1..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/orm/OrmOneToOneMapping2_0Composite.java +++ /dev/null @@ -1,131 +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.ui.internal.jpa2.details.orm; - -import org.eclipse.jpt.core.context.AccessHolder; -import org.eclipse.jpt.core.context.orm.OrmOneToOneMapping; -import org.eclipse.jpt.core.jpa2.context.OrphanRemovable2_0; -import org.eclipse.jpt.core.jpa2.context.OrphanRemovalHolder2_0; -import org.eclipse.jpt.core.jpa2.context.orm.OrmOneToOneMapping2_0; -import org.eclipse.jpt.ui.WidgetFactory; -import org.eclipse.jpt.ui.internal.details.AccessTypeComposite; -import org.eclipse.jpt.ui.internal.details.CascadeComposite; -import org.eclipse.jpt.ui.internal.details.FetchTypeComposite; -import org.eclipse.jpt.ui.internal.details.OneToOneJoiningStrategyPane; -import org.eclipse.jpt.ui.internal.details.OptionalComposite; -import org.eclipse.jpt.ui.internal.details.TargetEntityComposite; -import org.eclipse.jpt.ui.internal.jpa2.details.AbstractOneToOneMapping2_0Composite; -import org.eclipse.jpt.ui.internal.jpa2.details.DerivedIdentity2_0Pane; -import org.eclipse.jpt.ui.internal.jpa2.details.OrphanRemoval2_0Composite; -import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter; -import org.eclipse.jpt.utility.model.value.PropertyValueModel; -import org.eclipse.swt.widgets.Composite; - -/** - * Here the layout of this pane: - * <pre> - * ----------------------------------------------------------------------------- - * | ------------------------------------------------------------------------- | - * | | | | - * | | TargetEntityComposite | | - * | | | | - * | ------------------------------------------------------------------------- | - * | ------------------------------------------------------------------------- | - * | | | | - * | | DerivedIdentity2_0Pane | | - * | | | | - * | ------------------------------------------------------------------------- | - * | ------------------------------------------------------------------------- | - * | | | | - * | | OneToOneJoiningStrategyPane | | - * | | | | - * | ------------------------------------------------------------------------- | - * | ------------------------------------------------------------------------- | - * | | | | - * | | AccessTypeComposite | | - * | | | | - * | ------------------------------------------------------------------------- | - * | ------------------------------------------------------------------------- | - * | | | | - * | | FetchTypeComposite | | - * | | | | - * | ------------------------------------------------------------------------- | - * | ------------------------------------------------------------------------- | - * | | | | - * | | OptionalComposite | | - * | | | | - * | ------------------------------------------------------------------------- | - * | ------------------------------------------------------------------------- | - * | | | | - * | | CascadeComposite | | - * | | | | - * | ------------------------------------------------------------------------- | - * | ------------------------------------------------------------------------- | - * | | | | - * | | OrphanRemoval2_0Composite | | - * | | | | - * | ------------------------------------------------------------------------- | - * -----------------------------------------------------------------------------</pre> - * - * @see {@link OrmOneToOneMapping2_0} - * @see {@link OrmOneToOneMapping2_0UiProvider} - * @see {@link TargetEntityComposite} - * @see {@link DerivedId2_0Pane} - * @see {@link OneToOneJoiningStrategyPane} - * @see {@link AccessTypeComposite} - * @see {@link FetchTypeComposite} - * @see {@link OptionalComposite} - * @see {@link CascadeComposite} - * @see {@link OrphanRemoval2_0Composite} - */ -public class OrmOneToOneMapping2_0Composite<T extends OrmOneToOneMapping2_0> - extends AbstractOneToOneMapping2_0Composite<T> -{ - public OrmOneToOneMapping2_0Composite( - PropertyValueModel<? extends T> subjectHolder, - Composite parent, - WidgetFactory widgetFactory) { - - super(subjectHolder, parent, widgetFactory); - } - - - @Override - protected void initializeLayout(Composite container) { - int groupBoxMargin = getGroupBoxMargin(); - - new TargetEntityComposite(this, addPane(container, groupBoxMargin)); - new DerivedIdentity2_0Pane(this, buildDerivedIdentityHolder(), container); - new OneToOneJoiningStrategyPane(this, buildJoiningHolder(), container); - new AccessTypeComposite(this, buildAccessHolderHolder(), addPane(container, groupBoxMargin)); - new FetchTypeComposite(this, addPane(container, groupBoxMargin)); - new OptionalComposite(this, addPane(container, groupBoxMargin)); - new OrphanRemoval2_0Composite(this, buildOrphanRemovableHolder(), addPane(container, groupBoxMargin)); - new CascadeComposite(this, buildCascadeHolder(), addSubPane(container, 5)); - } - - protected PropertyValueModel<AccessHolder> buildAccessHolderHolder() { - return new PropertyAspectAdapter<OrmOneToOneMapping, AccessHolder>(getSubjectHolder()) { - @Override - protected AccessHolder buildValue_() { - return this.subject.getPersistentAttribute(); - } - }; - } - - protected PropertyValueModel<OrphanRemovable2_0> buildOrphanRemovableHolder() { - return new PropertyAspectAdapter<T, OrphanRemovable2_0>(getSubjectHolder()) { - @Override - protected OrphanRemovable2_0 buildValue_() { - return ((OrphanRemovalHolder2_0) this.subject).getOrphanRemoval(); - } - }; - } -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/orm/OrmQueries2_0Composite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/orm/OrmQueries2_0Composite.java deleted file mode 100644 index 7fce6a0086..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/orm/OrmQueries2_0Composite.java +++ /dev/null @@ -1,43 +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.ui.internal.jpa2.details.orm; - -import org.eclipse.jpt.core.context.QueryContainer; -import org.eclipse.jpt.core.context.orm.EntityMappings; -import org.eclipse.jpt.ui.internal.details.QueriesComposite; -import org.eclipse.jpt.ui.internal.details.orm.OrmQueriesComposite; -import org.eclipse.jpt.ui.internal.jpa2.details.Queries2_0Composite; -import org.eclipse.jpt.ui.internal.widgets.Pane; -import org.eclipse.jpt.utility.model.value.PropertyValueModel; -import org.eclipse.swt.widgets.Composite; - -/** - * OrmQueries2_0Composite - */ -public class OrmQueries2_0Composite extends OrmQueriesComposite { - - /** - * Creates a new <code>OrmQueries2_0Composite</code>. - * - * @param parentPane The parent container of this one - * @param parent The parent container - */ - public OrmQueries2_0Composite(Pane<? extends EntityMappings> parentPane, - Composite parent) { - - super(parentPane, parent); - } - - @Override - protected QueriesComposite buildQueriesComposite(Composite container, PropertyValueModel<QueryContainer> queryContainerHolder) { - return new Queries2_0Composite(this, queryContainerHolder, container); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/orm/OrmVersionMapping2_0Composite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/orm/OrmVersionMapping2_0Composite.java deleted file mode 100644 index 2ffb8726b9..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/orm/OrmVersionMapping2_0Composite.java +++ /dev/null @@ -1,55 +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.ui.internal.jpa2.details.orm; - -import org.eclipse.jpt.core.context.AccessHolder; -import org.eclipse.jpt.core.context.orm.OrmVersionMapping; -import org.eclipse.jpt.ui.WidgetFactory; -import org.eclipse.jpt.ui.internal.details.AbstractVersionMappingComposite; -import org.eclipse.jpt.ui.internal.details.AccessTypeComposite; -import org.eclipse.jpt.ui.internal.details.ColumnComposite; -import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter; -import org.eclipse.jpt.utility.model.value.PropertyValueModel; -import org.eclipse.swt.widgets.Composite; - -public class OrmVersionMapping2_0Composite extends AbstractVersionMappingComposite<OrmVersionMapping> -{ - /** - * 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 OrmVersionMapping2_0Composite(PropertyValueModel<? extends OrmVersionMapping> subjectHolder, - Composite parent, - WidgetFactory widgetFactory) { - - super(subjectHolder, parent, widgetFactory); - } - - @Override - protected void initializeLayout(Composite container) { - // Column widgets - new ColumnComposite(this, buildColumnHolder(), container); - new AccessTypeComposite(this, buildAccessHolderHolder(), container); - - initializeConversionPane(container); - } - - protected PropertyValueModel<AccessHolder> buildAccessHolderHolder() { - return new PropertyAspectAdapter<OrmVersionMapping, AccessHolder>(getSubjectHolder()) { - @Override - protected AccessHolder buildValue_() { - return this.subject.getPersistentAttribute(); - } - }; - } -}
\ No newline at end of file diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/orm/OrmXml2_0UiDefinition.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/orm/OrmXml2_0UiDefinition.java deleted file mode 100644 index 5ab8499f46..0000000000 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/orm/OrmXml2_0UiDefinition.java +++ /dev/null @@ -1,96 +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.ui.internal.jpa2.details.orm; - -import java.util.List; -import org.eclipse.jpt.core.JpaResourceType; -import org.eclipse.jpt.core.JptCorePlugin; -import org.eclipse.jpt.core.context.AttributeMapping; -import org.eclipse.jpt.core.context.TypeMapping; -import org.eclipse.jpt.ui.ResourceUiDefinition; -import org.eclipse.jpt.ui.details.orm.OrmAttributeMappingUiDefinition; -import org.eclipse.jpt.ui.details.orm.OrmTypeMappingUiDefinition; -import org.eclipse.jpt.ui.details.orm.OrmXmlUiFactory; -import org.eclipse.jpt.ui.internal.details.orm.AbstractOrmXmlResourceUiDefinition; -import org.eclipse.jpt.ui.internal.details.orm.OrmBasicMappingUiDefinition; -import org.eclipse.jpt.ui.internal.details.orm.OrmEmbeddableUiDefinition; -import org.eclipse.jpt.ui.internal.details.orm.OrmEmbeddedIdMappingUiDefinition; -import org.eclipse.jpt.ui.internal.details.orm.OrmEmbeddedMappingUiDefinition; -import org.eclipse.jpt.ui.internal.details.orm.OrmEntityUiDefinition; -import org.eclipse.jpt.ui.internal.details.orm.OrmIdMappingUiDefinition; -import org.eclipse.jpt.ui.internal.details.orm.OrmManyToManyMappingUiDefinition; -import org.eclipse.jpt.ui.internal.details.orm.OrmManyToOneMappingUiDefinition; -import org.eclipse.jpt.ui.internal.details.orm.OrmMappedSuperclassUiDefinition; -import org.eclipse.jpt.ui.internal.details.orm.OrmOneToManyMappingUiDefinition; -import org.eclipse.jpt.ui.internal.details.orm.OrmOneToOneMappingUiDefinition; -import org.eclipse.jpt.ui.internal.details.orm.OrmTransientMappingUiDefinition; -import org.eclipse.jpt.ui.internal.details.orm.OrmVersionMappingUiDefinition; -import org.eclipse.jpt.ui.internal.jpa2.GenericOrmXml2_0UiFactory; -import org.eclipse.jpt.ui.internal.structure.OrmResourceModelStructureProvider; -import org.eclipse.jpt.ui.structure.JpaStructureProvider; - -public class OrmXml2_0UiDefinition extends AbstractOrmXmlResourceUiDefinition -{ - // singleton - private static final ResourceUiDefinition INSTANCE = new OrmXml2_0UiDefinition(); - - - /** - * Return the singleton - */ - public static ResourceUiDefinition instance() { - return INSTANCE; - } - - - /** - * Enforce singleton usage - */ - private OrmXml2_0UiDefinition() { - super(); - } - - - @Override - protected OrmXmlUiFactory buildOrmXmlUiFactory() { - return new GenericOrmXml2_0UiFactory(); - } - - public boolean providesUi(JpaResourceType resourceType) { - return resourceType.equals(JptCorePlugin.ORM_XML_2_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()); - - definitions.add(OrmElementCollectionMapping2_0UiDefinition.instance()); - } - - @Override - protected void addOrmTypeMappingUiDefinitionsTo(List<OrmTypeMappingUiDefinition<? extends TypeMapping>> definitions) { - definitions.add(OrmEntityUiDefinition.instance()); - definitions.add(OrmMappedSuperclassUiDefinition.instance()); - definitions.add(OrmEmbeddableUiDefinition.instance()); - } -} |