Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jwt-dev] AW: Custom Properties

Hi Sachin, all

Have a look at http://wiki.eclipse.org/JWT_Metamodel_Extension and all aspect themed plugins in the source (under we/jwt-we-plugins : epcview, staticaspect...).

Err... as said on this wiki page, "multiple" means "more than one can be created" on a given node and not that it will not share the value, which it never does ! That said, your use case is exactly about aspects.

Is your dropdown change listener problem related to aspects or not ?


About auto hide of properties... I'm wondering whether it is rather a UI, EMF or Custom Property question.

Indeed, JWT Aspects allow to add features without hacking the decorated model, but in order to customize the behaviour (events and listeners) or the display (in the property sheet using the emf.edit framework) you actually have to customize the code generated by EMF from your ecore+genmodel. Which implies you have to be in the 3rd case "For developers : developing complex additional model extensions using EMF-generated code" described at http://wiki.eclipse.org/JWT_Metamodel_Extension , exemplified by the staticaspect sample, rather than Custom Properties (which are the 1rst case on the page). Then you can do anything.

How do custom properties work ? Well, thanks to EMF ! More precisely :
Custom Properties are shown in their own property tab by a modified version of the standard EMF property sheet that you can find in jwt-we-conf-model.we , that uses jwt-conf-property-model.edit's PropertyPropertyDescriptor to display each property.

So by setting in JWT your own property tab, you could display in it your own custom property sheet. This one could either be a copy of jwt-we-conf-model.we's that would differ only in that it would use your own MyPropertyPropertyDescriptor, whose getLabel() would return "" and createPropertyEditor() would return null when you don't want them. Or you could completely rewrite your custom property sheet with code that is specific to your (aspected) model, so it would look more like Forms UI.

It is of great importance to understand that Custom Properties are a nice way to get introduced to Aspects and get custom features on one's model, but once you want custom behaviour or display, you have to define your own Aspects model and code your needs the "classic" EMF way... Though you can take ideas from the Custom Property plugin to make your own aspect of course !


Another thing to try could be not at the UI level, but at the EMF.edit level, and write your own PropertyItemProvider that would sometimes NOT add the ItemPropertyDescriptor to the list, hoping it would therefore not display the custom property. Maybe easier to try, but very limited in possible further behaviours.


Finally, if there is a real need of being able to code when to display properties and when not, maybe we could add an extension point that would do the trick. However, that would not solve your other (?) custom EMF needs, and right now I don't know when I'd have the time for that.

Regards,
Marc

err... as said

Florian Lautenbacher a écrit :

Hi Sachin,

so basically what you will need for your aspects is to set the multiple-property in the metamodel to true. This provides the possibility to have different values for each action whereas multiple=false says that each action would have the same e.g. “wait time”.

Concerning the change listener, I’m not the expert here, but I guess that it evaluates the toString-value of the field and maybe with a drop down box it always stays the same? Maybe Chris or Marc can assist you here...

Concerning the automatic display or hiding properties in the custom properties dialog Marc is definitely the right person to ask – I don’t have an idea about that; sorry!

Best regards,

Florian

*Von:* Sachin N. Chavan [mailto:Sachin.Chavan@xxxxxxxxxx]
*Gesendet:* Freitag, 23. Oktober 2009 08:55
*An:* Florian Lautenbacher
*Cc:* 'Java Workflow Toolbox'
*Betreff:* Custom Properties

Hi Florian,

We have a requirement where in we wanted to display a set of custom properties based on the “Executed By Application” property value of the selected “Action”.

The value of the custom properties would be different for each node in the process.

For e.g. Lets say I have a “Wait” Action in my process. The value of “wait time” custom property would be different for each Action (node) in the process.

In order to achieve the functionality similar to the one described above, we were trying to extend the org.eclipse.jwt.we.changeListener and also to change the aspects (custom properties of Action being implemented using aspects) dynamically in the Listener implementation.

As described in the jwt-we-helpers-application example, the Change Notification Listener worked for “feature” like name (which was a string and plain textbox) by extending the org.eclipse.jwt.we.changeListener. But in case of the dropdown (list box), the notification is not effected and the Listener implementation doesn’t appear to work if the value of the dropdown is changed.

Are we missing something here? Also is there a way to invoke/display/hide certain aspects (custom properties) dynamically based on the user selection (in this case selection of a particular drop-down value from the list).

Any ideas/pointers/examples/comments to achieve such functionality are highly appreciated.

Thanks & Regards,

Sachin


MASTEK LTD.
Mastek is in NASSCOM's 'India Top 20' Software Service Exporters List.
In the US, we're called MAJESCOMASTEK

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Opinions expressed in this e-mail are those of the individual and not that of Mastek Limited, unless specifically indicated to that effect. Mastek Limited does not accept any responsibility or liability for it. This e-mail and attachments (if any) transmitted with it are confidential and/or privileged and solely for the use of the intended person or entity to which it is addressed. Any review, re-transmission, dissemination or other use of or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. This e-mail and its attachments have been scanned for the presence of computer viruses. It is the responsibility of the recipient to run the virus check on e-mails and attachments before opening them. If you have received this e-mail in error, kindly delete this e-mail from desktop and server.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

------------------------------------------------------------------------

_______________________________________________
jwt-dev mailing list
jwt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/jwt-dev


Back to the top