Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Programmatically Validate Diagram(Show source errors in the diagram)
Programmatically Validate Diagram [message #1494439] Mon, 01 December 2014 13:22 Go to next message
Koen Staal is currently offline Koen StaalFriend
Messages: 70
Registered: October 2014
Member
When the source files of the diagram contains errors they are not automaticly shown in the diagram. Only after selecting "validate diagram" in the context the menu the errors are shown. I want to call the validate more often.

How can i programmatically call the validate diagram function?

[Updated on: Mon, 01 December 2014 13:23]

Report message to a moderator

Re: Programmatically Validate Diagram [message #1504534 is a reply to message #1494439] Tue, 09 December 2014 10:35 Go to previous messageGo to next message
Koen Staal is currently offline Koen StaalFriend
Messages: 70
Registered: October 2014
Member
I came across this post, dont know how i didnt find it when searching earlier:
https://www.eclipse.org/forums/index.php/t/822391/

It suggests to use the ValidateAction class. When you have set the correct selected objects (which i did with a workaround) it wil show the errors in a new dialog. It wont show the icons in the diagram.

The solution:
DialectEditor.validateRepresentation()

I totally missed this easy solution with the dialectEditor, because i was working from IEditorPart which is returned when using DialectUIManager.INSTANCE.openEditor();

[Updated on: Tue, 09 December 2014 10:37]

Report message to a moderator

Re: Programmatically Validate Diagram [message #1504817 is a reply to message #1504534] Tue, 09 December 2014 15:35 Go to previous message
Steve Monnier is currently offline Steve MonnierFriend
Messages: 572
Registered: May 2011
Senior Member
Hello,

I'm glad you found a solution. You can have a look on ValidationAction
use with the test
org.eclipse.sirius.tests.unit.api.validation.DiagramValidationTest.java

Regards,
Steve

Le 09/12/2014 11:35, Koen Staal a écrit :
> I came across this post, dont know how i missed it the first time:
> https://www.eclipse.org/forums/index.php/t/822391/
>
> It suggests to use the ValidateAction class. When you have set the
> correct selected objects (which i did with a workaround) it wil show the
> errors in a new dialog. It wont show the icons in the diagram.
>
> The solution:
> DialectEditor.validateRepresentation()
>
> I totally missed this easy solution with the dialectEditor, because i
> was working from IEditorPart which is returned when using
> DialectUIManager.INSTANCE.openEditor();


--
Steve Monnier - Obeo

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


Steve Monnier - Obeo Canada
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Previous Topic:Newline option not available when table is empty
Next Topic:Enable Popup Bars for creation edges tools
Goto Forum:
  


Current Time: Thu Apr 25 15:02:06 GMT 2024

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

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

Back to the top