Skip to main content



      Home
Home » Modeling » Graphiti » Restrain features in the Diagram View Example
Restrain features in the Diagram View Example [message #1097269] Thu, 29 August 2013 09:20 Go to next message
Eclipse UserFriend
Hi there,

I'm looking at the Diagram View Example and I wonder if it may be
possible to divide up features that may be executed in the diagram
opened in the editor from features that may only be executed in the
diagram opened in a view.

Is it possible ?

Yours,

--
Nicolas H
Re: Restrain features in the Diagram View Example [message #1097389 is a reply to message #1097269] Thu, 29 August 2013 12:45 Go to previous messageGo to next message
Eclipse UserFriend
Hi again,

Le 29/08/13 15:25, Nicolas H a écrit :> Hi there,
>
> I'm looking at the Diagram View Example and I wonder if it may be
> possible to divide up features that may be executed in the diagram
> opened in the editor from features that may only be executed in the
> diagram opened in a view.
>
> Is it possible ?
>
> Yours,
>

I found a way to do that.

In my class extending AbstractDiagramTypeProvider, I override the init
method like this :

@Override
public void init(Diagram diagram, IDiagramBehavior diagramBehavior) {
super.init(diagram, diagramBehavior);
if (this.getDiagramBehavior().getDiagramContainer() instanceof
DiagramComposite) { // Inside a View
setFeatureProvider(new MyRestrainedFeatureProvider(this));
}
else { // Inside the editor
setFeatureProvider(new MyFeatureProvider(this));
}
}

MyRestrainedFeatureProvider extends MyFeatureProvider and disables some
features.


Do you think it's a good solution ?

Yours,

--
Nicolas H
Re: Restrain features in the Diagram View Example [message #1097942 is a reply to message #1097389] Fri, 30 August 2013 07:22 Go to previous messageGo to next message
Eclipse UserFriend
It does look good to me Rolling Eyes
Re: Restrain features in the Diagram View Example [message #1097991 is a reply to message #1097942] Fri, 30 August 2013 08:45 Go to previous message
Eclipse UserFriend
Hi Felix,

Le 30/08/13 13:22, Felix Velasco a écrit :
> It does look good to me :roll:

Thank you for your feedback. I gonna deal with this approach in depth.

Regards,

--
Nicolas H
Previous Topic:Custom DirectEditManager
Next Topic:graphiti diagram editor xmi persistence encoding
Goto Forum:
  


Current Time: Tue Jul 22 19:21:45 EDT 2025

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

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

Back to the top