Skip to main content



      Home
Home » Eclipse Projects » Sirius » Undo operation in sirius editor
Undo operation in sirius editor [message #1794558] Sun, 02 September 2018 22:46 Go to next message
Eclipse UserFriend
Hi,

I have a model with 2 elements,
Step 1: Create a sirius diagram of the model, the diagram show the 2 elements.
Step 2: Save the diagram and close it.
Step 3: Delete one element on EMF editor, and save the model.
Step 4: Open the sirius diagram, the diagram synchronized from the model, and shows the remaining element.
Step 5: Press 'Ctrl + z' on the diagram to execute undo operation. The diagram show the deleted element with a red cross flag.

My question is, is it reasonable to allow undo operation while the diagram opened?
Re: Undo operation in sirius editor [message #1794652 is a reply to message #1794558] Tue, 04 September 2018 09:49 Go to previous messageGo to next message
Eclipse UserFriend
Hi, I don't reproduce but anyway why do you think we should forbid undo?

Regards
Re: Undo operation in sirius editor [message #1794691 is a reply to message #1794652] Tue, 04 September 2018 22:08 Go to previous messageGo to next message
Eclipse UserFriend
Hi, Pierre,
I produced this problem in Obeo Designer 8.1.

I know the reason is that, sirius synchronize diagram from model at opening time, this may remove some diagram elements (which the back-end model element does not exist). When user trigger undo operation, sirius bring the removed diagram elements back.

I'm not wanting to forbid undo. It is nice to show a red cross flag if the element is not exist anymore, but it make user confused sometimes.

[Updated on: Tue, 04 September 2018 22:09] by Moderator

Re: Undo operation in sirius editor [message #1794712 is a reply to message #1794691] Wed, 05 September 2018 06:21 Go to previous messageGo to next message
Eclipse UserFriend
Hi,
I am not sure to understand when the red cross is visible, what undo is done, and what does mean the removed element is back and what is confusing for user.

If you click refresh, it disappear?

Regards
Re: Undo operation in sirius editor [message #1794748 is a reply to message #1794712] Wed, 05 September 2018 23:22 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

index.php/fa/33822/0/
  • Attachment: All.jpg
    (Size: 66.69KB, Downloaded 335 times)

[Updated on: Wed, 05 September 2018 23:26] by Moderator

Re: Undo operation in sirius editor [message #1794781 is a reply to message #1794748] Thu, 06 September 2018 08:28 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

This is the refresh command called "Refresh diagram on opening" that is undone. If this is too much confusing for you, you can open a Sirius ticket .
What you can do though is to clear the command stack with a SessionManageListener:
Register it with SessionManager.INSTANCE.addSessionsListener(sessionManagerListener) and use the code:
private final SessionManagerListener sessionManagerListener = new SessionManagerListener.Stub() {
        @Override
        public void notify(Session session, int notification) {
           if (notification == SessionListener.OPENED) {
         session.getTransactionalEditingDomain().getCommandStack().flush();
        }
    };


Regards,
Re: Undo operation in sirius editor [message #1794811 is a reply to message #1794781] Thu, 06 September 2018 21:49 Go to previous messageGo to next message
Eclipse UserFriend
Hi, Pierre

Thank you very much, i'll try it.
Re: Undo operation in sirius editor [message #1794826 is a reply to message #1794811] Fri, 07 September 2018 05:19 Go to previous message
Eclipse UserFriend
In fact I think this will not work. The cleaning of the command stack should be done when the editor has finished its opening, not the session.
Previous Topic:Observe creation/deletion of Representations/Descriptors
Next Topic:[Sirius-ELK] ELK integration of Sirius
Goto Forum:
  


Current Time: Wed Jul 23 15:45:25 EDT 2025

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

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

Back to the top