| /******************************************************************************* |
| * 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.VersionMapping; |
| import org.eclipse.jpt.eclipselink.ui.internal.details.EclipseLinkMutableComposite; |
| import org.eclipse.jpt.eclipselink.ui.internal.details.EclipseLinkVersionMappingComposite; |
| import org.eclipse.jpt.ui.WidgetFactory; |
| 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 OrmEclipseLinkVersionMapping1_1Composite extends EclipseLinkVersionMappingComposite |
| { |
| /** |
| * 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 OrmEclipseLinkVersionMapping1_1Composite(PropertyValueModel<? extends VersionMapping> subjectHolder, |
| Composite parent, |
| WidgetFactory widgetFactory) { |
| |
| super(subjectHolder, parent, widgetFactory); |
| } |
| |
| @Override |
| protected void initializeGeneralPane(Composite container) { |
| int groupBoxMargin = getGroupBoxMargin(); |
| |
| // Column widgets |
| new ColumnComposite(this, buildColumnHolder(), container); |
| |
| // Align the widgets under the ColumnComposite |
| container = addSubPane(container, 0, groupBoxMargin, 0, groupBoxMargin); |
| |
| new AccessTypeComposite(this, buildAccessHolderHolder(), container); |
| new EclipseLinkMutableComposite(this, buildMutableHolder(), container); |
| } |
| |
| protected PropertyValueModel<AccessHolder> buildAccessHolderHolder() { |
| return new PropertyAspectAdapter<VersionMapping, AccessHolder>(getSubjectHolder()) { |
| @Override |
| protected AccessHolder buildValue_() { |
| return this.subject.getPersistentAttribute(); |
| } |
| }; |
| } |
| } |