Skip to main content



      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 09:21 Go to next message
Eclipse UserFriend
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 09:45] by Moderator

Re: Java Service Not Called From Style Customization [message #1808952 is a reply to message #1808864] Thu, 04 July 2019 18:19 Go to previous messageGo to next message
Eclipse UserFriend
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 09:09 Go to previous messageGo to next message
Eclipse UserFriend
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,

[Updated on: Fri, 05 July 2019 09:14] by Moderator

Re: Java Service Not Called From Style Customization [message #1810054 is a reply to message #1808984] Tue, 30 July 2019 03:11 Go to previous messageGo to next message
Eclipse UserFriend
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 09:54 Go to previous message
Eclipse UserFriend
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.

[Updated on: Tue, 30 July 2019 09:54] by 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: Sun Jul 27 16:20:05 EDT 2025

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

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

Back to the top