Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Hiding synchronized edges programmatically
Hiding synchronized edges programmatically [message #1406844] Mon, 11 August 2014 08:43 Go to next message
Benoit Ries is currently offline Benoit RiesFriend
Messages: 83
Registered: May 2013
Member
Hi,

I wish to hide programmatically associations which are displayed in synchronized mode when pressing the "Delete" key.

For this I use the following code below, which works perfectly ok for DNodes, but fails for DEdges. What happens exactly for edges is that the edges are hidden but then re-appear automatically.

Would anyone have a clue why and how to solve it ?


-----

public class ExternalJavaActionDelete implements IExternalJavaAction2 {

public ExternalJavaActionDelete() {}

public boolean canExecute(Collection<? extends EObject> selections) {
return true;
}

public void execute(Collection<? extends EObject> selections, Map<String, Object> parameters) {
Object elt = parameters.get("param");
if (elt instanceof DDiagramElement) {
DDiagramElement dDiagramElement = (DDiagramElement) elt;
HideFilterHelper.INSTANCE.hide(dDiagramElement);
}
}

public boolean mayDeleteElements() {
return false;
}
}
Re: Hiding synchronized edges programmatically [message #1406919 is a reply to message #1406844] Mon, 11 August 2014 12:48 Go to previous message
Esteban Dugueperoux is currently offline Esteban DugueperouxFriend
Messages: 472
Registered: July 2009
Senior Member
Hi,

This should works. Could you provide a sample to reproduce your issue.

Best Regards.

Le 11/08/2014 10:43, Benoit Ries a écrit :
> Hi,
>
> I wish to hide programmatically associations which are displayed in
> synchronized mode when pressing the "Delete" key.
>
> For this I use the following code below, which works perfectly ok for
> DNodes, but fails for DEdges. What happens exactly for edges is that the
> edges are hidden but then re-appear automatically.
>
> Would anyone have a clue why and how to solve it ?
>
>
> -----
>
> public class ExternalJavaActionDelete implements IExternalJavaAction2 {
>
> public ExternalJavaActionDelete() {}
>
> public boolean canExecute(Collection<? extends EObject> selections) {
> return true;
> }
>
> public void execute(Collection<? extends EObject> selections,
> Map<String, Object> parameters) {
> Object elt = parameters.get("param");
> if (elt instanceof DDiagramElement) {
> DDiagramElement dDiagramElement = (DDiagramElement) elt;
> HideFilterHelper.INSTANCE.hide(dDiagramElement);
> }
> }
>
> public boolean mayDeleteElements() {
> return false;
> }
> }


--
Esteban Dugueperoux - Obeo

Need professional services for Sirius?
http://www.obeodesigner.com/sirius
Previous Topic:Custom DSL with Sirius
Next Topic:Restriction of posisble elements in feature column
Goto Forum:
  


Current Time: Sat Apr 04 13:12:05 GMT 2020

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

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

Back to the top