Skip to main content



      Home
Home » Modeling » Graphiti » Read-Only Graphiti Diagrams
Read-Only Graphiti Diagrams [message #677170] Tue, 07 June 2011 15:03 Go to next message
Eclipse UserFriend
Can anyone suggest a strategy for displaying a read-only Graphiti diagram? The use case would allow users to inspect a diagram and select elements, but not create, move, delete, or edit elements. Selection is required to allow access to element property sheets.
Re: Read-Only Graphiti Diagrams [message #677381 is a reply to message #677170] Wed, 08 June 2011 06:59 Go to previous messageGo to next message
Eclipse UserFriend
You can create a read-only version of your Graphiti diagram editor by providing an additional feature provider (FP). If this FP does not provide any modifying features, the diagram could not be changed. It is also possible to switch between editing an RO mode. Some intersting sources for you could be the following ones:
SketchViewerModeToolBehavior, ConfigurableFeatureProviderWrapper
Re: Read-Only Graphiti Diagrams [message #677468 is a reply to message #677170] Wed, 08 June 2011 11:43 Go to previous messageGo to next message
Eclipse UserFriend
See http://www.eclipse.org/forums/index.php/mv/msg/207099/663075/#msg_663075.

Redefining all the named features effectively makes the diagram read only. We did this because we generate the layout automatically and do not want the user to be able to change it.

Jos
Re: Read-Only Graphiti Diagrams [message #677511 is a reply to message #677468] Wed, 08 June 2011 13:31 Go to previous messageGo to next message
Eclipse UserFriend
Thank you both.

I extended my ToolBehaviorProvider implemented IFeatureCheckerHolder and supplied a new FeatureCheckerAdapter(false). Then wrapped my IFeatureProvider in a ConfigurableFeatureProviderWrapper and Viola! It might sound scary, but the whole thing was pretty trivial after I understood how the example Christian cited worked.

Jos, I can see why your solution is more appropriate for your situation. I need both a editable and a read-only version of the editor, so the ability to just disable the whole thing when needed worked out best for me.

Thanks again.
Re: Read-Only Graphiti Diagrams [message #681983 is a reply to message #677511] Fri, 10 June 2011 03:32 Go to previous messageGo to next message
Eclipse UserFriend
Perhaps we should take a read-only chapter into our documentation... Smile
Re: Read-Only Graphiti Diagrams [message #850752 is a reply to message #677511] Fri, 20 April 2012 05:42 Go to previous message
Eclipse UserFriend
Rhett Hudson wrote on Wed, 08 June 2011 13:31
Thank you both.

I extended my ToolBehaviorProvider implemented IFeatureCheckerHolder and supplied a new FeatureCheckerAdapter(false). Then wrapped my IFeatureProvider in a ConfigurableFeatureProviderWrapper and Viola! It might sound scary, but the whole thing was pretty trivial after I understood how the example Christian cited worked.

Jos, I can see why your solution is more appropriate for your situation. I need both a editable and a read-only version of the editor, so the ability to just disable the whole thing when needed worked out best for me.

Thanks again.


Hi, sorry for my poor English I am Italian.I also need both a editable and a read-only version of the editor, can me explain better how can I do it? Thank you very much!
Previous Topic:Search within a diagram
Next Topic:Possible to add a source tab?
Goto Forum:
  


Current Time: Mon Jul 07 11:15:15 EDT 2025

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

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

Back to the top