| /******************************************************************************* |
| * 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.eclipselink.ui.internal.v1_1.details.orm; |
| |
| import org.eclipse.jpt.core.context.AccessHolder; |
| import org.eclipse.jpt.eclipselink.core.context.EclipseLinkBasicMapMapping; |
| 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; |
| |
| /** |
| * |
| * @version 2.2 |
| * @since 2.2 |
| */ |
| public class OrmEclipseLinkBasicMapMapping1_1Composite extends Pane<EclipseLinkBasicMapMapping> |
| implements JpaComposite |
| { |
| /** |
| * Creates a new <code>EclipseLinkBasicCollectionMappingComposite</code>. |
| * |
| * @param subjectHolder The holder of the subject <code>IManyToOneMapping</code> |
| * @param parent The parent container |
| * @param widgetFactory The factory used to create various common widgets |
| */ |
| public OrmEclipseLinkBasicMapMapping1_1Composite(PropertyValueModel<? extends EclipseLinkBasicMapMapping> subjectHolder, |
| Composite parent, |
| WidgetFactory widgetFactory) { |
| |
| super(subjectHolder, parent, widgetFactory); |
| } |
| |
| @Override |
| protected void initializeLayout(Composite container) { |
| new AccessTypeComposite(this, buildAccessHolderHolder(), container); |
| } |
| |
| protected PropertyValueModel<AccessHolder> buildAccessHolderHolder() { |
| return new PropertyAspectAdapter<EclipseLinkBasicMapMapping, AccessHolder>(getSubjectHolder()) { |
| @Override |
| protected AccessHolder buildValue_() { |
| return this.subject.getPersistentAttribute(); |
| } |
| }; |
| } |
| } |