blob: 91951d0c2e9beccc8f7c5075b4648018f458c040 [file] [log] [blame]
/*******************************************************************************
* 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.eclipselink.ui.internal.v1_1.details.orm;
import org.eclipse.jpt.core.context.AccessHolder;
import org.eclipse.jpt.core.context.EmbeddedIdMapping;
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.FormPane;
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
*
* @version 2.2
* @since 2.2
*/
public class OrmEclipseLinkEmbeddedIdMapping1_1Composite extends FormPane<EmbeddedIdMapping>
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 OrmEclipseLinkEmbeddedIdMapping1_1Composite(PropertyValueModel<? extends EmbeddedIdMapping> 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<EmbeddedIdMapping, AccessHolder>(getSubjectHolder()) {
@Override
protected AccessHolder buildValue_() {
return this.subject.getPersistentAttribute();
}
};
}
}