Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Read-only properties without ItemPropertyDescriptor
Read-only properties without ItemPropertyDescriptor [message #1728643] Wed, 06 April 2016 08:28 Go to next message
Mathieu Cartaud is currently offline Mathieu CartaudFriend
Messages: 4
Registered: April 2016
Junior Member
Hi everyone,

I have two editors used to open and edit my models. With one of those editors, I want to have some properties of my objects read-only:
If an object of the model have non-containment references to an object. And if this latter object is defined in a metamodel located in a different resource than the metamodel of root of the model, then it should not be editable.

The ItemPropertyDescriptor doesn't seems to fit my needs and it is attached to the objects so it will affect all editors (as far as I know)

Is there a way of doing this?

Thanks for your time

Re: Read-only properties without ItemPropertyDescriptor [message #1728688 is a reply to message #1728643] Wed, 06 April 2016 12:51 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 29545
Registered: July 2009
Senior Member
Mathieu,

Comments below.


On 06.04.2016 14:32, Mathieu Cartaud wrote:
> Hi everyone,
>
> I have two editors used to open and edit my models. With one of those
> editors, I want to have some properties of my objects read-only: If an
> object of the model have non-containment references to an object. And
> if this latter object is defined in a metamodel located in a different
> resource than the metamodel of root of the model, then it should not
> be editable.
I'm not sure I follow that!
>
> The ItemPropertyDescriptor doesn't seems to fit my needs and it is
> attached to the objects so it will affect all editors (as far as I know)
Each editor generally has its own item providers...
>
> Is there a way of doing this?
The org.eclipse.emf.edit.provider.ItemPropertyDescriptor.isSettable is
referenced only by
org.eclipse.emf.edit.provider.ItemPropertyDescriptor.canSetProperty(Object)
so perhaps you can embed the logic that determine if the property is
editor or not in a specialized version of that method.
>
> Thanks for your time
>
>
Previous Topic:What is best practice for referencing an external graphic (pjeg, jif, etc...) in a EMF .ecore model?
Next Topic:EMF enum literals
Goto Forum:
  


Current Time: Sat Sep 22 01:29:51 GMT 2018

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

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

Back to the top