blob: 0467f48b141ee33bbf805bb1524783cc3ac0baf0 [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2005, 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.jpa.ui.internal.jpa2.details.java;
import org.eclipse.jpt.common.ui.WidgetFactory;
import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
import org.eclipse.jpt.jpa.core.context.AccessHolder;
import org.eclipse.jpt.jpa.core.context.MappedSuperclass;
import org.eclipse.jpt.jpa.core.context.java.JavaMappedSuperclass;
import org.eclipse.jpt.jpa.ui.details.JpaComposite;
import org.eclipse.jpt.jpa.ui.internal.details.AbstractMappedSuperclassComposite;
import org.eclipse.jpt.jpa.ui.internal.details.AccessTypeComposite;
import org.eclipse.jpt.jpa.ui.internal.details.IdClassComposite;
import org.eclipse.jpt.jpa.ui.internal.details.java.BaseJavaUiFactory;
import org.eclipse.swt.widgets.Composite;
/**
* Here the layout of this pane:
* <pre>
* -----------------------------------------------------------------------------
* | |
* | IdClassComposite |
* | |
* -----------------------------------------------------------------------------</pre>
*
* @see MappedSuperclass
* @see BaseJavaUiFactory - The factory creating this pane
* @see IdClassComposite
*
* @version 2.3
* @since 2.0
*/
public class JavaMappedSuperclass2_0Composite
extends AbstractMappedSuperclassComposite<JavaMappedSuperclass>
implements JpaComposite
{
/**
* Creates a new <code>MappedSuperclassComposite</code>.
*
* @param subjectHolder The holder of this pane's subject
* @param parent The parent container
* @param widgetFactory The factory used to create various common widgets
*/
public JavaMappedSuperclass2_0Composite(
PropertyValueModel<? extends JavaMappedSuperclass> subjectHolder,
Composite parent,
WidgetFactory widgetFactory) {
super(subjectHolder, parent, widgetFactory);
}
@Override
protected void initializeMappedSuperclassSection(Composite container) {
new AccessTypeComposite(this, buildAccessHolder(), container);
new IdClassComposite(this, buildIdClassReferenceHolder(), container);
}
protected PropertyValueModel<AccessHolder> buildAccessHolder() {
return new PropertyAspectAdapter<JavaMappedSuperclass, AccessHolder>(getSubjectHolder()) {
@Override
protected AccessHolder buildValue_() {
return this.subject.getPersistentType();
}
};
}
}