blob: fc69df4d1cd81c5e5bc1832d0103a36d03a19f51 [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2005, 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.ui.internal.jpa2.java.details;
import org.eclipse.jpt.core.context.AccessHolder;
import org.eclipse.jpt.core.context.java.JavaMappedSuperclass;
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.mappings.details.IdClassComposite;
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 the layout of this pane:
* <pre>
* -----------------------------------------------------------------------------
* | |
* | IdClassComposite |
* | |
* -----------------------------------------------------------------------------</pre>
*
* @see MappedSuperclass
* @see BaseJpaUiFactory - The factory creating this pane
* @see IdClassComposite
*
* @version 2.0
* @since 2.0
*/
public class JavaMappedSuperclass2_0Composite extends FormPane<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 initializeLayout(Composite container) {
new AccessTypeComposite(this, buildAccessHolder(), container);
new IdClassComposite(this, container);
}
protected PropertyValueModel<AccessHolder> buildAccessHolder() {
return new PropertyAspectAdapter<JavaMappedSuperclass, AccessHolder>(
getSubjectHolder())
{
@Override
protected AccessHolder buildValue_() {
return this.subject.getPersistentType();
}
};
}
}