How to display a reference [message #1856682] |
Thu, 22 December 2022 13:35 |
Geoffry Roberts Messages: 7 Registered: December 2022 |
Junior Member |
|
|
All,
I have an EMF model where one class references another class 1..1, Let's label these as "parent child".'
In the EMF Forms preview, the parent displays but the child can be made into a hyperlink, which when clicked displays the child in a popup window.
Q: Is there any way, using the View Editor, to have the child display automatically along with its parent without the user having to click anything?
I can get both parent and child to display together if I use something like a GridLayout and then call ECPSWTViewRenderer repeatedly for each. Is this a better way to handle things?
I realize I asked a similar question in an earlier post.
A little code to illustrate this second approach.
void createPropertiesPage(Composite parent) {
try {
final Composite content = new Composite(parent, SWT.NONE);
GridLayout layout = new GridLayout();
layout.numColumns = 1;
layout.makeColumnsEqualWidth = true;
content.setLayout(layout);
ECPSWTView ev1 = ECPSWTViewRenderer.INSTANCE.render(content, getALFProjectModel());
GridDataFactory.swtDefaults()
.grab(true, false)
.minSize(100, SWT.DEFAULT).align(SWT.FILL, SWT.CENTER).applyTo(ev1.getSWTControl());
ECPSWTView ev2 = ECPSWTViewRenderer.INSTANCE.render(content, getALFProject());
GridDataFactory.swtDefaults()
.grab(true, false)
.minSize(100, SWT.DEFAULT).align(SWT.FILL, SWT.CENTER).applyTo(ev2.getSWTControl());
int index = addPage(content);
setPageText(index, "Properties");
parent.layout();
} catch (ECPRendererException e) {
LOG.error("", e);
}
}
Thanks
|
|
|
|
Powered by
FUDForum. Page generated in 0.01512 seconds