Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [EMFForms] Custom ECPRendererTester
[EMFForms] Custom ECPRendererTester [message #1603690] Fri, 06 February 2015 10:29 Go to next message
Dennis Melzer is currently offline Dennis MelzerFriend
Messages: 244
Registered: July 2009
Senior Member
Hello,

i created a custom renderer for an "path" attribute (textfield with button for file browser). The renderer is very similar to the example email custom renderer and the example tester too.

Is there a more generic solution for the tester? The tester depends on a special ecore model. So for every new model i have to adpat the tester.

public class EmailControlRendererTest implements ECPRendererTester {
 
    public int isApplicableForFeature(EStructuralFeature feature, VElement vElement, ViewModelContext context) {
        //here is my problem
        if (feature.equals(TaskPackage.eINSTANCE.getUser_Email())) {
            return 10;
        }
        return NOT_APPLICABLE;
    }

 
}



Thx Smile
Re: [EMFForms] Custom ECPRendererTester [message #1606949 is a reply to message #1603690] Sun, 08 February 2015 14:39 Go to previous messageGo to next message
Jonas Helming is currently offline Jonas HelmingFriend
Messages: 699
Registered: July 2009
Senior Member
Hi,

you would need some kind of identification mechanism to mark "path"
attributes as such. Solutions could be:
- An annotation to the attribute
- The definition of a custom data type (in ecore)

second would also the advantage that you could validate the attribute.

Best regards

Jonas


Am 06.02.2015 um 11:29 schrieb Dennis Melzer:
> Hello,
>
> i created a custom renderer for an "path" attribute (textfield with
> button for file browser). The renderer is very similar to the example
> email custom renderer and the example tester too.
>
> Is there a more generic solution for the tester? The tester depends on a
> special ecore model. So for every new model i have to adpat the tester.
>
>
> public class EmailControlRendererTest implements ECPRendererTester {
>
> public int isApplicableForFeature(EStructuralFeature feature,
> VElement vElement, ViewModelContext context) {
> //here is my problem
> if (feature.equals(TaskPackage.eINSTANCE.getUser_Email())) {
> return 10;
> }
> return NOT_APPLICABLE;
> }
>
>
> }
>
>
>
> Thx :)


--
Get professional Eclipse developer support:
http://eclipsesource.com/en/services/developer-support/
Re: [EMFForms] Custom ECPRendererTester [message #1609707 is a reply to message #1606949] Tue, 10 February 2015 09:31 Go to previous message
Dennis Melzer is currently offline Dennis MelzerFriend
Messages: 244
Registered: July 2009
Senior Member
Hi Jonas,

thanks that sounds good to use EDataType.

Best regards

Dennis
Previous Topic:[EMFForms] Values Vanish when using Show Rule
Next Topic:[EMF.Edit] IItemPropertyDescriptor EReference
Goto Forum:
  


Current Time: Wed Apr 24 22:38:47 GMT 2024

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

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

Back to the top