1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
|
/*******************************************************************************
* Copyright (c) 2010, 2013 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
*
* Contributors:
* Oracle - initial API and implementation
******************************************************************************/
package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm;
import org.eclipse.jface.resource.ResourceManager;
import org.eclipse.jpt.common.ui.WidgetFactory;
import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
import org.eclipse.jpt.jpa.core.jpa2.context.EmbeddedIdMapping2_0;
import org.eclipse.jpt.jpa.eclipselink.ui.details.JptJpaEclipseLinkUiDetailsMessages;
import org.eclipse.jpt.jpa.ui.JptJpaUiMessages;
import org.eclipse.jpt.jpa.ui.details.orm.JptJpaUiDetailsOrmMessages;
import org.eclipse.jpt.jpa.ui.internal.details.AbstractEmbeddedIdMappingComposite;
import org.eclipse.jpt.jpa.ui.internal.details.AccessTypeComboViewer;
import org.eclipse.jpt.jpa.ui.internal.details.EmbeddedMappingOverridesComposite;
import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmMappingNameText;
import org.eclipse.jpt.jpa.ui.internal.jpa2.details.EmbeddedIdMappingMappedByRelationshipPane2_0;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.ui.forms.widgets.Hyperlink;
public class EclipseLinkOrmEmbeddedIdMappingComposite2_0
extends AbstractEmbeddedIdMappingComposite<EmbeddedIdMapping2_0>
{
public EclipseLinkOrmEmbeddedIdMappingComposite2_0(
PropertyValueModel<? extends EmbeddedIdMapping2_0> mappingModel,
PropertyValueModel<Boolean> enabledModel,
Composite parentComposite,
WidgetFactory widgetFactory,
ResourceManager resourceManager) {
super(mappingModel, enabledModel, parentComposite, widgetFactory, resourceManager);
}
@Override
protected Control initializeEmbeddedIdSection(Composite container) {
container = this.addSubPane(container, 2, 0, 0, 0, 0);
// Name widgets
this.addLabel(container, JptJpaUiDetailsOrmMessages.ORM_MAPPING_NAME_CHOOSER_NAME);
new OrmMappingNameText(this, getSubjectHolder(), container);
// Attribute type widgets
Hyperlink attributeTypeHyperlink = this.addHyperlink(container, JptJpaEclipseLinkUiDetailsMessages.ORM_ATTRIBUTE_TYPE_COMPOSITE_ATTRIBUTE_TYPE);
new EclipseLinkOrmAttributeTypeClassChooser(this, getSubjectHolder(), container, attributeTypeHyperlink);
// Access type widgets
this.addLabel(container, JptJpaUiMessages.ACCESS_TYPE_COMPOSITE_ACCESS);
new AccessTypeComboViewer(this, this.buildAccessReferenceModel(), container);
// Mapped by relationship widgets
EmbeddedIdMappingMappedByRelationshipPane2_0 mappedByRelationshipPane = new EmbeddedIdMappingMappedByRelationshipPane2_0(this, getSubjectHolder(), container);
GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
gridData.horizontalSpan = 2;
mappedByRelationshipPane.getControl().setLayoutData(gridData);
// Overrides widgets
EmbeddedMappingOverridesComposite overridesComposite = new EmbeddedMappingOverridesComposite(
this,
container);
gridData = new GridData(GridData.FILL_HORIZONTAL);
gridData.horizontalSpan = 2;
overridesComposite.getControl().setLayoutData(gridData);
return container;
}
}
|