| /******************************************************************************* |
| * Copyright (c) 2007, 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.ui.internal.jpa2.details.java; |
| |
| import org.eclipse.jpt.core.context.AccessHolder; |
| import org.eclipse.jpt.core.context.java.JavaEmbeddable; |
| import org.eclipse.jpt.ui.WidgetFactory; |
| import org.eclipse.jpt.ui.details.JpaComposite; |
| import org.eclipse.jpt.ui.internal.details.AbstractEmbeddableComposite; |
| import org.eclipse.jpt.ui.internal.details.AccessTypeComposite; |
| import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter; |
| import org.eclipse.jpt.utility.model.value.PropertyValueModel; |
| import org.eclipse.swt.widgets.Composite; |
| |
| /** |
| * This pane does not have any widgets. |
| * |
| * @see Embeddable |
| * @see EmbeddableUiProvider |
| * |
| * @version 2.3 |
| * @since 2.0 |
| */ |
| public class JavaEmbeddable2_0Composite extends AbstractEmbeddableComposite<JavaEmbeddable> |
| implements JpaComposite |
| { |
| /** |
| * Creates a new <code>EmbeddableComposite</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 JavaEmbeddable2_0Composite(PropertyValueModel<? extends JavaEmbeddable> subjectHolder, |
| Composite parent, |
| WidgetFactory widgetFactory) { |
| |
| super(subjectHolder, parent, widgetFactory); |
| } |
| |
| @Override |
| protected void initializeLayout(Composite container) { |
| this.initializeEmbeddableCollapsibleSection(container); |
| } |
| |
| @Override |
| protected void initializeEmbeddableSection(Composite container) { |
| new AccessTypeComposite(this, buildAccessHolder(), container); |
| } |
| |
| protected PropertyValueModel<AccessHolder> buildAccessHolder() { |
| return new PropertyAspectAdapter<JavaEmbeddable, AccessHolder>( |
| getSubjectHolder()) |
| { |
| @Override |
| protected AccessHolder buildValue_() { |
| return this.subject.getPersistentType(); |
| } |
| }; |
| } |
| |
| } |