Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » How to make a Class and an Interface read-only?
How to make a Class and an Interface read-only? [message #197557] Thu, 17 July 2008 08:58 Go to next message
Eclipse UserFriend
Originally posted by: tsimunovic.gmail.com

Is it possible to make a Class and an Interface read-only, ie. to finalize
it so that no further modifications, such as adding new attributes or
making connections from it, could be done? If not, what modifications of
the GMF (or/and EMF,GEF) should I perform to get this function?
Re: How to make a Class and an Interface read-only? [message #197589 is a reply to message #197557] Thu, 17 July 2008 09:31 Go to previous messageGo to next message
Gary is currently offline GaryFriend
Messages: 125
Registered: July 2009
Senior Member
If you wish to make all the classes Read only, simply set the 'Read Only'
attribute at 'Gen Diagram Generator -> Property Sheet" to be true!

Hope this helps!
Re: How to make a Class and an Interface read-only? [message #197628 is a reply to message #197589] Thu, 17 July 2008 09:52 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: tsimunovic.gmail.com

I'm not sure if I was clear enough. I'm using the UML2 plug-in which uses
GMF as graphic tool. What I need is to make only some of the classes and
interfaces non modificable, because once created (and compiled in java
code) they would become a standard and shouldn't be modified anymore.
Other classes could be added, modified to the diagram, and could have
connections TO the finalized/read-only classes and interfaces (extend or
implement them in Java terms). If I understood correctly (I'm a newbee in
the whole plug-in/EMF/GEF/GMF/UML2 thing), You're suggesting to make whole
model read-only, and that's not what I need. Thanks for a quick response
anyway.
Re: How to make a Class and an Interface read-only? [message #197665 is a reply to message #197628] Thu, 17 July 2008 10:02 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello Tom,

See org.eclipse.gmf.runtime.diagram.ui.internal.editparts.IEdita bleEditPart.disableEditMode().
In addition you can play with <yourEditPart>.isEditModeEnabled() implementation
to make EditPart editable/readonly based on some model properties..

-----------------
Alex Shatalin
Re: How to make a Class and an Interface read-only? [message #197672 is a reply to message #197628] Thu, 17 July 2008 10:06 Go to previous message
Gary is currently offline GaryFriend
Messages: 125
Registered: July 2009
Senior Member
yes sorry the way I suggested would make the entire diagram non-editable!
Previous Topic:Accessing model classes/objects from their Graphical Elements
Next Topic:tool groups
Goto Forum:
  


Current Time: Sat Jun 06 12:14:08 GMT 2020

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

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

Back to the top