[Xtext 2.1] property databinding in own dsl [message #757800] |
Mon, 21 November 2011 13:00  |
Eclipse User |
|
|
|
Hey,
in case of the domainmodel example: What would be the best approach to realise a databinding in a custom dsl?
With databinding I mean typing a (nested) property in some view input's attribute so that it can be read and written in different states of the application like e.g. in JSF, Flex etc..
entity.referenceA.referenceB
Is there some extension point in xbase for this case?
regards,
Max
[Updated on: Wed, 23 November 2011 20:57] by Moderator
|
|
|
|
|
|
|
|
Re: property databinding in own dsl [message #758902 is a reply to message #758887] |
Fri, 25 November 2011 01:59  |
Eclipse User |
|
|
|
Finally, after reading some other posts I realised, that in this case it is better to use a validator: The user sees the scope he expects and gets a message that informs him about the required property binding.
However, I had another problem where I wanted to hide every method of a boundary class in the scope because I generate methods from expressions in a view language. Inside a expression several view properties should be visible but not my generated methods. Also the problem targeted with this thread should be solved by a custom implementation of VisibilityService and binding in MyLangRuntimeModule:
public class UclVisibilityService extends VisibilityService {
@Inject
private IJvmModelAssociations associations;
@Override
public boolean isVisible(final JvmMember jvmMember, JvmDeclaredType contextType) {
final EObject o = associations.getPrimarySourceElement(jvmMember.eContainer());
if (o instanceof View && jvmMember instanceof JvmOperation)
return false;
return super.isVisible(jvmMember, contextType);
}
}
regards,
Max
[Updated on: Fri, 25 November 2011 02:00] by Moderator
|
|
|
Powered by
FUDForum. Page generated in 0.06127 seconds