|
Lines 57-63
public class MELinkControl {
Link Here
|
| 57 |
protected FormToolkit toolkit; |
57 |
protected FormToolkit toolkit; |
| 58 |
private org.eclipse.emf.ecp.editor.ModelElementChangeListener modelElementChangeListener; |
58 |
private org.eclipse.emf.ecp.editor.ModelElementChangeListener modelElementChangeListener; |
| 59 |
private ECPModelelementContext context; |
59 |
private ECPModelelementContext context; |
| 60 |
|
60 |
private IItemPropertyDescriptor pDescriptor; |
| 61 |
public ECPModelelementContext getContext() { |
61 |
public ECPModelelementContext getContext() { |
| 62 |
return context; |
62 |
return context; |
| 63 |
} |
63 |
} |
|
Lines 66-77
public class MELinkControl {
Link Here
|
| 66 |
this.context = context; |
66 |
this.context = context; |
| 67 |
} |
67 |
} |
| 68 |
|
68 |
|
|
|
69 |
|
| 69 |
/** |
70 |
/** |
| 70 |
* {@inheritDoc} |
71 |
* {@inheritDoc} |
| 71 |
*/ |
72 |
*/ |
| 72 |
public Control createControl(final Composite parent, int style, IItemPropertyDescriptor itemPropertyDescriptor, |
73 |
public Control createControl(final Composite parent, int style, IItemPropertyDescriptor itemPropertyDescriptor, |
| 73 |
final EObject link, EObject contextModelElement, FormToolkit toolkit, ECPModelelementContext context) { |
74 |
final EObject link, EObject contextModelElement, FormToolkit toolkit, ECPModelelementContext context) { |
| 74 |
this.context = context; |
75 |
this.context = context; |
|
|
76 |
pDescriptor=itemPropertyDescriptor; |
| 75 |
Object feature = itemPropertyDescriptor.getFeature(link); |
77 |
Object feature = itemPropertyDescriptor.getFeature(link); |
| 76 |
this.eReference = (EReference) feature; |
78 |
this.eReference = (EReference) feature; |
| 77 |
this.link = link; |
79 |
this.link = link; |
|
Lines 84-90
public class MELinkControl {
Link Here
|
| 84 |
protected Control createControl(final Composite parent, int style) { |
86 |
protected Control createControl(final Composite parent, int style) { |
| 85 |
linkComposite = toolkit.createComposite(parent, style); |
87 |
linkComposite = toolkit.createComposite(parent, style); |
| 86 |
linkComposite.setLayout(new GridLayout(3, false)); |
88 |
linkComposite.setLayout(new GridLayout(3, false)); |
| 87 |
|
89 |
if (!pDescriptor.canSetProperty(contextModelElement)) { |
|
|
90 |
linkComposite.setEnabled(false); |
| 91 |
} |
| 88 |
createHyperlink(parent, style); |
92 |
createHyperlink(parent, style); |
| 89 |
createDeleteAction(style); |
93 |
createDeleteAction(style); |
| 90 |
return linkComposite; |
94 |
return linkComposite; |