Skip to main content


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 19:03 Go to next message
Rhett Hudson is currently offline Rhett HudsonFriend
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 10:59 Go to previous messageGo to next message
Christian Brand is currently offline Christian BrandFriend
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 15:43 Go to previous messageGo to next message
Jos Warmer is currently offline Jos WarmerFriend
Messages: 114
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 17:31 Go to previous messageGo to next message
Rhett Hudson is currently offline Rhett HudsonFriend
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 07:32 Go to previous messageGo to next message
Christian Brand is currently offline Christian BrandFriend
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 09:42 Go to previous message
Andrea Ficeti is currently offline Andrea FicetiFriend
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: Fri Dec 27 01:00:26 GMT 2024

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

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

Back to the top