blob: e868e960ed7598a4afc851c6c338c8d4dba45636 [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2007, 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.mappings.details;
import org.eclipse.jpt.core.context.AssociationOverride;
import org.eclipse.jpt.core.context.AttributeOverride;
import org.eclipse.jpt.core.context.Entity;
import org.eclipse.jpt.ui.WidgetFactory;
import org.eclipse.jpt.ui.internal.widgets.FormPane;
import org.eclipse.jpt.ui.internal.widgets.Pane;
import org.eclipse.jpt.utility.model.value.PropertyValueModel;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.part.PageBook;
/**
* Here the layout of this pane:
* <pre>
* -----------------------------------------------------------------------------
* | |
* | - Attribute Overrides --------------------------------------------------- |
* | | --------------------------------------------------------------------- | |
* | | | | | |
* | | | AddRemoveListPane | | |
* | | | | | |
* | | --------------------------------------------------------------------- | |
* | | | |
* | | x Override Default | |
* | | | |
* | | --------------------------------------------------------------------- | |
* | | | | | |
* | | | PageBook (AttributeOverrideComposite/AssociationOverrideComposite)| | |
* | | | | | |
* | | --------------------------------------------------------------------- | |
* | ------------------------------------------------------------------------- |
* -----------------------------------------------------------------------------</pre>
*
* @see Entity
* @see EntityComposite - The parent container
* @see AttributeOverrideComposite
* @see AssociationOverrideComposite
*
* @version 2.0
* @since 1.0
*/
public class OverridesComposite extends AbstractOverridesComposite
{
/**
* Creates a new <code>OverridesComposite</code>.
*
* @param parentPane The parent controller of this one
* @param parent The parent container
*/
public OverridesComposite(FormPane<? extends Entity> parentPane,
Composite parent) {
super(parentPane, parent);
}
/**
* Creates a new <code>OverridesComposite</code>.
*
* @param subjectHolder The holder of the subject <code>IEntity</code>
* @param parent The parent container
* @param widgetFactory The factory used to create various common widgets
*/
public OverridesComposite(PropertyValueModel<? extends Entity> subjectHolder,
Composite parent,
WidgetFactory widgetFactory) {
super(subjectHolder, parent, widgetFactory);
}
@Override
protected Pane<AttributeOverride> buildAttributeOverridePane(PageBook pageBook, PropertyValueModel<AttributeOverride> attributeOverrideHolder) {
return new AttributeOverrideComposite(this, attributeOverrideHolder, pageBook);
}
@Override
protected Pane<AssociationOverride> buildAssociationOverridePane(PageBook pageBook, PropertyValueModel<AssociationOverride> associationOverrideHolder) {
return new AssociationOverrideComposite(this, associationOverrideHolder, pageBook);
}
}