Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Graphiti » Restrain features in the Diagram View Example
Restrain features in the Diagram View Example [message #1097269] Thu, 29 August 2013 13:20 Go to next message
Eclipse User
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 16:45 Go to previous messageGo to next message
Eclipse User
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 11:22 Go to previous messageGo to next message
Felix Velasco is currently offline Felix Velasco
Messages: 43
Registered: July 2009
Member
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 12:45 Go to previous message
Eclipse User
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 Oct 21 21:31:52 GMT 2014

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

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