Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Java Service Not Called From Style Customization(Java Service Not Called)
Java Service Not Called From Style Customization [message #1808864] Wed, 03 July 2019 13:21 Go to next message
Adrian Yankov is currently offline Adrian YankovFriend
Messages: 16
Registered: March 2018
Junior Member
Hello, everybody.

I have a style customization on a layer that enables and disables an icon.
However, because there is a bug in Sirius and it does not get updated after I disable or Enable the layer, only when I change the model, I decided to add a another style customization that refreshes the whole diagram.

I created a simple class that looks like this:


import org.eclipse.emf.ecore.EObject;

public class RefreshService {
public void refreshAll(EObject obj) {
System.out.println(obj);
}

}

However, when I add service:refreshAll() to the expression field, it never gets called. If I add a custom tool, the service does get called, but that's not the idea. The class has also been added as a Java extension.

I need this fixed really urgently. Thank you for your help in advance.

[Updated on: Wed, 03 July 2019 13:45]

Report message to a moderator

Re: Java Service Not Called From Style Customization [message #1808952 is a reply to message #1808864] Thu, 04 July 2019 22:19 Go to previous messageGo to next message
Adrian Yankov is currently offline Adrian YankovFriend
Messages: 16
Registered: March 2018
Junior Member
Update:
I added a constructor of the class, and now when the diagram loads,
at least I see that the empty constructor is called.
Re: Java Service Not Called From Style Customization [message #1808984 is a reply to message #1808952] Fri, 05 July 2019 13:09 Go to previous messageGo to next message
Pierre Guilet is currently offline Pierre GuiletFriend
Messages: 250
Registered: June 2017
Senior Member
Hi,

Your bug is fixed since SIrius 5.0.0. Which version of Sirius do you have?

However, a fix exists for your situation. Your layer is considered as transient so no refresh is done. To consider it no transient you can just create an empty mapping like node mapping that will do nothing. But this will make the layer no transient and the refresh will be call, the SIrius refresh not yours that will be useless with the mapping.

Regards,


Pierre Guilet - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius

[Updated on: Fri, 05 July 2019 13:14]

Report message to a moderator

Re: Java Service Not Called From Style Customization [message #1810054 is a reply to message #1808984] Tue, 30 July 2019 07:11 Go to previous messageGo to next message
Adrian Yankov is currently offline Adrian YankovFriend
Messages: 16
Registered: March 2018
Junior Member
Thank you for the answer.
I will try it.
I am using 6.3.
Re: Java Service Not Called From Style Customization [message #1810086 is a reply to message #1810054] Tue, 30 July 2019 13:54 Go to previous message
Pierre-Charles David is currently offline Pierre-Charles DavidFriend
Messages: 702
Registered: July 2009
Senior Member
Adrian Yankov wrote on Tue, 30 July 2019 09:11
Thank you for the answer.
I will try it.
I am using 6.3.


Please note that Sirius 6.3 is not released: it corresponds to the current in-development version. We try to keep master stable at all times, but it is not validated and things may change from day to day without notice (if you are pointing to the latest build).

The latest released version is 6.2.2.


Pierre-Charles David - Obeo

Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius

[Updated on: Tue, 30 July 2019 13:54]

Report message to a moderator

Previous Topic:ArrangeAll is not working as expected if we create the instances programatically
Next Topic:How to get selected diagram element with java plugin
Goto Forum:
  


Current Time: Tue Apr 16 05:44:24 GMT 2024

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

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

Back to the top