blob: 5812be83a41838fdabff1091cd8c68e7aee321c8 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
|
/*******************************************************************************
* 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.details;
import org.eclipse.jpt.core.context.AttributeOverride;
import org.eclipse.jpt.core.context.Column;
import org.eclipse.jpt.ui.internal.widgets.Pane;
import org.eclipse.jpt.utility.internal.model.value.TransformationPropertyValueModel;
import org.eclipse.jpt.utility.model.value.PropertyValueModel;
import org.eclipse.swt.widgets.Composite;
/**
* Here the layout of this pane:
* <pre>
* -----------------------------------------------------------------------------
* | |
* | ColumnComposite |
* | |
* -----------------------------------------------------------------------------</pre>
*
* @see AttributeOverride
* @see EntityOverridesComposite - The parent container
* @see ColumnComposite
*
* @version 2.0
* @since 1.0
*/
public class AttributeOverrideComposite extends Pane<AttributeOverride>
{
/**
* Creates a new <code>AttributeOverrideComposite</code>.
*
* @param subjectHolder The holder of the subject <code>AttributeOverride</code>
* @param parent The parent container
* @param widgetFactory The factory used to create various common widgets
*/
public AttributeOverrideComposite(Pane<?> parentPane,
PropertyValueModel<? extends AttributeOverride> subjectHolder,
Composite parent) {
super(parentPane, subjectHolder, parent);
}
@Override
protected void initializeLayout(Composite container) {
new ColumnComposite(
this,
buildColumnHolder(),
container,
false
);
}
private PropertyValueModel<Column> buildColumnHolder() {
return new TransformationPropertyValueModel<AttributeOverride, Column>(getSubjectHolder()) {
@Override
protected Column transform_(AttributeOverride value) {
return value.getColumn();
}
};
}
}
|