/******************************************************************************* * 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.orm.details; import org.eclipse.jpt.core.context.AccessHolder; import org.eclipse.jpt.core.context.IdMapping; import org.eclipse.jpt.eclipselink.ui.internal.mappings.details.EclipseLinkIdMappingComposite; import org.eclipse.jpt.eclipselink.ui.internal.mappings.details.MutableComposite; import org.eclipse.jpt.ui.WidgetFactory; import org.eclipse.jpt.ui.internal.details.AccessTypeComposite; import org.eclipse.jpt.ui.internal.mappings.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 EclipseLink1_1OrmIdMappingComposite extends EclipseLinkIdMappingComposite { /** * Creates a new public. * * @param subjectHolder The holder of the subject IdMapping * @param parent The parent container * @param widgetFactory The factory used to create various common widgets */ public EclipseLink1_1OrmIdMappingComposite(PropertyValueModel 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 MutableComposite(this, buildMutableHolder(), container); } protected PropertyValueModel buildAccessHolderHolder() { return new PropertyAspectAdapter(getSubjectHolder()) { @Override protected AccessHolder buildValue_() { return this.subject.getPersistentAttribute(); } }; } }