Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Graphiti » Read-Only Graphiti Diagrams
Read-Only Graphiti Diagrams [message #677170] Tue, 07 June 2011 15:03 Go to next message
Rhett Hudson is currently offline Rhett Hudson
Messages: 43
Registered: September 2010
Member
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
Christian Brand is currently offline Christian Brand
Messages: 36
Registered: July 2009
Location: Walldorf/Germany
Member
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


Christian Brand
SAP AG - Walldorf - Germany
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
Jos Warmer is currently offline Jos Warmer
Messages: 108
Registered: October 2010
Senior Member
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
Rhett Hudson is currently offline Rhett Hudson
Messages: 43
Registered: September 2010
Member
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
Christian Brand is currently offline Christian Brand
Messages: 36
Registered: July 2009
Location: Walldorf/Germany
Member
Perhaps we should take a read-only chapter into our documentation... Smile

Christian Brand
SAP AG - Walldorf - Germany
Re: Read-Only Graphiti Diagrams [message #850752 is a reply to message #677511] Fri, 20 April 2012 05:42 Go to previous message
Andrea Ficeti is currently offline Andrea Ficeti
Messages: 1
Registered: April 2012
Junior Member
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: Thu Jul 24 23:51:08 EDT 2014

Powered by FUDForum. Page generated in 0.01670 seconds