Skip to main content



      Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » EMF Forms Services(EMFForms)
EMF Forms Services [message #1856689] Thu, 22 December 2022 16:30 Go to next message
Eclipse UserFriend
Q: How does one implement an EMF Form Service?

I have been reading up on EMF Forms Services. I need to get several of these working. The issue is I am not understanding how to do so.

I see code snippets on the site. I can't tell how to put them into my code. Where do they go? I gather I must place them in my app. Sounds like it's a cut and paste thing. But I am afraid I'm not getting it.

I'll show my code. (below) What follows is the function that instantiates my view/model. I highlighted in blue the code I pasted in from the website. I further highlighted in red classes that are not on the classpath. I highlighted in orange variables that I can't tell where they come from.
If anyone can shed any light my life will improve.


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());

//Cut&Paste from the website.
EMFFormsDatabinding databinding;
DataBindingContext dataBindingContext;
VDomainModelReference dmr = vControl.getDomainModelReference();
Text textControl = new Text(parent, SWT.SINGLE);
final IObservableValue value = SWTObservables.observeText(text, SWT.FocusOut);
IObservableValue modelValue=databinding.getObservableValue(dmr, viewModelContext.getDomainModel());
final Binding binding = dataBindingContext.bindValue(value, modelValue, null, null);

//end of Cut&Paste

int index = addPage(content);
setPageText(index, "Properties");
parent.layout();
} catch (ECPRendererException e) {
LOG.error("", e);
}
}


Thanks
Re: EMF Forms Services [message #1856693 is a reply to message #1856689] Fri, 23 December 2022 00:55 Go to previous message
Eclipse UserFriend
For some of these typed, you can try using Navigate -> Open Discovered Type to see if you can find them in some Eclipse Git repository.

So there is org.eclipse.core.databinding.DataBindingContext and I think SWTObservables is replaced by org.eclipse.jface.databinding.swt.typed.WidgetProperties.
Previous Topic:How to display a reference
Next Topic:EMF Forms evaluation
Goto Forum:
  


Current Time: Sun Jun 15 01:44:14 EDT 2025

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

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

Back to the top