Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » How to display a reference(EMFForms)
How to display a reference [message #1856682] Thu, 22 December 2022 13:35 Go to next message
Geoffry Roberts is currently offline Geoffry RobertsFriend
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
Re: How to display a reference [message #1856683 is a reply to message #1856682] Thu, 22 December 2022 14:19 Go to previous message
Geoffry Roberts is currently offline Geoffry RobertsFriend
Messages: 7
Registered: December 2022
Junior Member
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:-)
Previous Topic:Best tooling to replace Texo
Next Topic:EMF Forms Services
Goto Forum:
  


Current Time: Thu Apr 25 01:13:51 GMT 2024

Powered by FUDForum. Page generated in 0.03383 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top