How to display a reference [message #1856682] |
Thu, 22 December 2022 08:35  |
Eclipse User |
|
|
|
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
|
|
|
Re: How to display a reference [message #1856683 is a reply to message #1856682] |
Thu, 22 December 2022 09:19  |
Eclipse User |
|
|
|
Responding to my own post. I just now discovered "Eclipse Source View Model Elements page". I've been looking for something like this for three days. Do I need a better search engine? I was using Yahoo (the default on my new corporate computer) this search was with Bing.
Let me read through this new bit. It might solve my problems. Apologies to the EF people for all the bad things I said wrt a lack of documentation:-)
|
|
|
Powered by
FUDForum. Page generated in 0.06667 seconds