Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » EMF Forms Services(EMFForms)
EMF Forms Services [message #1856689] Thu, 22 December 2022 21:30 Go to next message
Geoffry Roberts is currently offline Geoffry RobertsFriend
Messages: 7
Registered: December 2022
Junior Member
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 05:55 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33143
Registered: July 2009
Senior Member
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.


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:How to display a reference
Next Topic:EMF Forms evaluation
Goto Forum:
  


Current Time: Thu May 02 15:33:37 GMT 2024

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

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

Back to the top