Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Making a diagram read-only
Making a diagram read-only [message #213866] Tue, 11 April 2006 11:44 Go to next message
Eclipse User
Originally posted by: markp.softlanding.com

I am using GEF 3.0.0. I have a diagram app that is loosely based on
the Shapes example. I want to be able to allow a user to open this
diagram in "read-only" mode. Is there some easy way to do this? It is
relatively easy to make changes so that you do not save anything, but
the user can still manipulate the diagram and see and use the palette.

Is the only way to do this to create a second editor?

Mark
Re: Making a diagram read-only [message #213958 is a reply to message #213866] Wed, 12 April 2006 02:23 Go to previous messageGo to next message
Andreas Schosser is currently offline Andreas Schosser
Messages: 30
Registered: July 2009
Member
Mark,

you could show the "read-only" diagram inside another view / another
editor or inside your exisiting editor.

If you like to create another view, you will just have to implement a
short ViewPart class:
http://www.eclipse.org/newsportal/article.php?id=16279&g roup=eclipse.tools.gef#16279

If you decide to use your existing editor, just remove the EditPolicys
installed to your diagram EditPart,
at least the COMPONENT_ROLE and the CONTAINER_ROLE policy.

Regards,

Andreas

--
A. Schosser
Mind8 GmbH

Mark Phippard wrote:

> I am using GEF 3.0.0. I have a diagram app that is loosely based on
> the Shapes example. I want to be able to allow a user to open this
> diagram in "read-only" mode. Is there some easy way to do this? It is
> relatively easy to make changes so that you do not save anything, but
> the user can still manipulate the diagram and see and use the palette.
>
> Is the only way to do this to create a second editor?
>
> Mark
Re: Making a diagram read-only [message #214782 is a reply to message #213958] Sun, 23 April 2006 01:01 Go to previous messageGo to next message
Eclipse User
Originally posted by: prostephen1983.hotmail.com

I think a short way is let all the EditPart install this
EditPolicy ----- RootComponentEditPolicy

this editpolicy make your model and view can not be removed.And you may
can not create a connection in your diagram.

I come from china and just a B.S in university.
And this is my first time here.
Thanks.
Re: Making a diagram read-only [message #214789 is a reply to message #213958] Sun, 23 April 2006 01:06 Go to previous messageGo to next message
Eclipse User
Originally posted by: tracdor.tom.com

Like GEF
Re: Making a diagram read-only [message #519277 is a reply to message #213958] Mon, 08 March 2010 06:11 Go to previous message
daniele Mising name is currently offline daniele Mising name
Messages: 48
Registered: July 2009
Member
Hi,

you can try --> [ActiveEditor] .getDiagramEditPart().disableEditMode();


you should do .disableEditMode for all the ShapeNodeEditPart of the editor.
However this method don't let you move the objects on the editor, but you can still change their property in the relativi sheet Sad

[Updated on: Mon, 08 March 2010 06:40]

Report message to a moderator

Previous Topic:properties view
Next Topic:Programatically change icon in tabs in the TabbedPropertyView
Goto Forum:
  


Current Time: Wed Jul 30 17:28:52 EDT 2014

Powered by FUDForum. Page generated in 0.01803 seconds