Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » making nodes read only
making nodes read only [message #795254] Fri, 10 February 2012 08:55 Go to next message
ganesh ram is currently offline ganesh ramFriend
Messages: 26
Registered: January 2012
Junior Member
Hi,

I drag n drop nodes from my palette on to the canvas.
I have set "Feature Sequence Initializer", so i set the attributes of that node by the time they are dropped on to the canvas.
How do i ensure that these nodes are read only ? ie i dont want the users to modify the attributes (using Properties View) of these nodes.
Re: making nodes read only [message #795350 is a reply to message #795254] Fri, 10 February 2012 11:19 Go to previous messageGo to next message
Michael Golubev is currently offline Michael GolubevFriend
Messages: 383
Registered: July 2009
Senior Member
Hello,

GMF-T does not support any kind of read-only-ness.

As a weak solution, you may try to remove the not allowed attributes from the property sheet by changing the
public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) 
in the XXXProvider class (yourmodel.edit plugin).

This change will affect all property sheets showing your model instances, if you want to have different property sheets for default EMF tree editor and GMF diagram, please search through this forum, I am pretty sure this topic had been discused here.

Please ask in the EMF forum how to maintain the "real" readonly mode, I guess that prohibiting ResourceSetListener registered as a pre-commit and throwing RollbackException on inappropriate changes may be suitable.

Regards,
Michael "Borlander" Golubev
at Montages Think Tank, Prague, Czech Republic
Montages AG, Zürich, Switzerland
Re: making nodes read only [message #795371 is a reply to message #795350] Fri, 10 February 2012 11:46 Go to previous messageGo to next message
ganesh ram is currently offline ganesh ramFriend
Messages: 26
Registered: January 2012
Junior Member
Michael,

That really helped, thanks Smile
Re: making nodes read only [message #798076 is a reply to message #795371] Tue, 14 February 2012 08:10 Go to previous message
Ralph Gerbig is currently offline Ralph GerbigFriend
Messages: 702
Registered: November 2009
Senior Member
Hi,

maybe you should set this in the genmodel. Go to the nodes of the feature you want to have read-only and set property type to readonly. If you do not want a feature to appear in the property sheet set it to none. You can automate this by using a transformation e.g. ATL as below:

rule GenFeature2GenFeatur{
 from 
  s : genmodel!GenFeature
  to
   t : genmodel!GenFeature(
    property <- #Readonly
  )
}
Previous Topic:How to download GMF plugins for solaris
Next Topic:Edit a list of parameters
Goto Forum:
  


Current Time: Sat Apr 20 00:24:06 GMT 2024

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

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

Back to the top