Skip to main content



      Home
Home » Modeling » GMF (Graphical Modeling Framework) » run Validation from custom Menu
run Validation from custom Menu [message #138240] Thu, 21 June 2007 06:10 Go to next message
Eclipse UserFriend
Hello,
I have a Custom Menu in my GMF diagram with a button "myValidate". I
want this button to run the Validation of the diagram (the same action
as in "Diagram/Validate" menu).

The problem is that I don't know how to access this IAction from the
Class that handels my menu actions.

How can I access this action in order to run it ?

thanks,
regards.
Tex.
Re: run Validation from custom Menu [message #138244 is a reply to message #138240] Thu, 21 June 2007 06:50 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: khai.n.situvista.com

In your generated ...diagram.providers package you should have a
XXXValidationProvider class with a static ValidateAction class defined
in it. From your menu item you can call the static method
ValidateAction.runValidation(view).

-- Khai --

Tex Twil wrote:
> Hello,
> I have a Custom Menu in my GMF diagram with a button "myValidate". I
> want this button to run the Validation of the diagram (the same action
> as in "Diagram/Validate" menu).
>
> The problem is that I don't know how to access this IAction from the
> Class that handels my menu actions.
>
> How can I access this action in order to run it ?
>
> thanks,
> regards.
> Tex.
Re: run Validation from custom Menu [message #138249 is a reply to message #138244] Thu, 21 June 2007 07:45 Go to previous messageGo to next message
Eclipse UserFriend
Hi,
yes that's what I found here :
http://dev.eclipse.org/newslists/news.eclipse.modeling.gmf/m sg06307.html

but in my XXXValidationProvider class I don't have the static class
ValidateAction class.

Tex.

Khai M Nguyen wrote:
> In your generated ...diagram.providers package you should have a
> XXXValidationProvider class with a static ValidateAction class defined
> in it. From your menu item you can call the static method
> ValidateAction.runValidation(view).
>
> -- Khai --
>
> Tex Twil wrote:
>> Hello,
>> I have a Custom Menu in my GMF diagram with a button "myValidate". I
>> want this button to run the Validation of the diagram (the same action
>> as in "Diagram/Validate" menu).
>>
>> The problem is that I don't know how to access this IAction from the
>> Class that handels my menu actions.
>>
>> How can I access this action in order to run it ?
>>
>> thanks,
>> regards.
>> Tex.
Re: run Validation from custom Menu [message #138255 is a reply to message #138249] Thu, 21 June 2007 09:31 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: 5d5.mail.ru

Now ValidateAction has it's own file.

Tex Twil wrote:
> Hi,
> yes that's what I found here :
> http://dev.eclipse.org/newslists/news.eclipse.modeling.gmf/m sg06307.html
>
> but in my XXXValidationProvider class I don't have the static class
> ValidateAction class.
>
> Tex.
>
> Khai M Nguyen wrote:
>> In your generated ...diagram.providers package you should have a
>> XXXValidationProvider class with a static ValidateAction class defined
>> in it. From your menu item you can call the static method
>> ValidateAction.runValidation(view).
>>
>> -- Khai --
>>
>> Tex Twil wrote:
>>> Hello,
>>> I have a Custom Menu in my GMF diagram with a button "myValidate". I
>>> want this button to run the Validation of the diagram (the same
>>> action as in "Diagram/Validate" menu).
>>>
>>> The problem is that I don't know how to access this IAction from the
>>> Class that handels my menu actions.
>>>
>>> How can I access this action in order to run it ?
>>>
>>> thanks,
>>> regards.
>>> Tex.
Re: run Validation from custom Menu [message #138370 is a reply to message #138255] Thu, 21 June 2007 09:45 Go to previous messageGo to next message
Eclipse UserFriend
Yes,
it's in package XXX.diagram.part.

I don't know where to get the parameter for the constructor:

ValidateAction(IWorkbenchPartDescriptor workbenchPartDescriptor)

Tex.


Dmitry Stadnik wrote:
> Now ValidateAction has it's own file.
>
> Tex Twil wrote:
>> Hi,
>> yes that's what I found here :
>> http://dev.eclipse.org/newslists/news.eclipse.modeling.gmf/m sg06307.html
>>
>> but in my XXXValidationProvider class I don't have the static class
>> ValidateAction class.
>>
>> Tex.
>>
>> Khai M Nguyen wrote:
>>> In your generated ...diagram.providers package you should have a
>>> XXXValidationProvider class with a static ValidateAction class
>>> defined in it. From your menu item you can call the static method
>>> ValidateAction.runValidation(view).
>>>
>>> -- Khai --
>>>
>>> Tex Twil wrote:
>>>> Hello,
>>>> I have a Custom Menu in my GMF diagram with a button "myValidate". I
>>>> want this button to run the Validation of the diagram (the same
>>>> action as in "Diagram/Validate" menu).
>>>>
>>>> The problem is that I don't know how to access this IAction from the
>>>> Class that handels my menu actions.
>>>>
>>>> How can I access this action in order to run it ?
>>>>
>>>> thanks,
>>>> regards.
>>>> Tex.
Re: run Validation from custom Menu [message #139546 is a reply to message #138370] Tue, 26 June 2007 10:13 Go to previous messageGo to next message
Eclipse UserFriend
ok,
I've just found the solution which is quite .... easy :)

(editor is a IEditorPart)

XXX.diagram.part.ValidateAction validateAction;

IWorkbenchPartDescriptor partDescriptor =
new WorkbenchPartDescriptor(
editor.getSite().getId(),
editor.getClass(),
editor.getSite().getPage());

validateAction = new ValidateAction(partDescriptor);
validateAction.run();

cheers,
Tex.


Tex Twil wrote:
> Yes,
> it's in package XXX.diagram.part.
>
> I don't know where to get the parameter for the constructor:
>
> ValidateAction(IWorkbenchPartDescriptor workbenchPartDescriptor)
>
> Tex.
>
>
> Dmitry Stadnik wrote:
>> Now ValidateAction has it's own file.
>>
>> Tex Twil wrote:
>>> Hi,
>>> yes that's what I found here :
>>> http://dev.eclipse.org/newslists/news.eclipse.modeling.gmf/m sg06307.html
>>>
>>> but in my XXXValidationProvider class I don't have the static class
>>> ValidateAction class.
>>>
>>> Tex.
>>>
>>> Khai M Nguyen wrote:
>>>> In your generated ...diagram.providers package you should have a
>>>> XXXValidationProvider class with a static ValidateAction class
>>>> defined in it. From your menu item you can call the static method
>>>> ValidateAction.runValidation(view).
>>>>
>>>> -- Khai --
>>>>
>>>> Tex Twil wrote:
>>>>> Hello,
>>>>> I have a Custom Menu in my GMF diagram with a button "myValidate".
>>>>> I want this button to run the Validation of the diagram (the same
>>>>> action as in "Diagram/Validate" menu).
>>>>>
>>>>> The problem is that I don't know how to access this IAction from
>>>>> the Class that handels my menu actions.
>>>>>
>>>>> How can I access this action in order to run it ?
>>>>>
>>>>> thanks,
>>>>> regards.
>>>>> Tex.
Re: run Validation from custom Menu [message #139849 is a reply to message #139546] Wed, 27 June 2007 06:35 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: 5d5.mail.ru

There should be a static method in ValidateAction class to run
validation; I think it's not necessary to instantiate it.

Tex Twil wrote:
> ok,
> I've just found the solution which is quite .... easy :)
>
> (editor is a IEditorPart)
>
> XXX.diagram.part.ValidateAction validateAction;
>
> IWorkbenchPartDescriptor partDescriptor =
> new WorkbenchPartDescriptor(
> editor.getSite().getId(),
> editor.getClass(),
> editor.getSite().getPage());
>
> validateAction = new ValidateAction(partDescriptor);
> validateAction.run();
>
> cheers,
> Tex.
>
>
> Tex Twil wrote:
>> Yes,
>> it's in package XXX.diagram.part.
>>
>> I don't know where to get the parameter for the constructor:
>>
>> ValidateAction(IWorkbenchPartDescriptor workbenchPartDescriptor)
>>
>> Tex.
>>
>>
>> Dmitry Stadnik wrote:
>>> Now ValidateAction has it's own file.
>>>
>>> Tex Twil wrote:
>>>> Hi,
>>>> yes that's what I found here :
>>>> http://dev.eclipse.org/newslists/news.eclipse.modeling.gmf/m sg06307.html
>>>>
>>>>
>>>> but in my XXXValidationProvider class I don't have the static class
>>>> ValidateAction class.
>>>>
>>>> Tex.
>>>>
>>>> Khai M Nguyen wrote:
>>>>> In your generated ...diagram.providers package you should have a
>>>>> XXXValidationProvider class with a static ValidateAction class
>>>>> defined in it. From your menu item you can call the static method
>>>>> ValidateAction.runValidation(view).
>>>>>
>>>>> -- Khai --
>>>>>
>>>>> Tex Twil wrote:
>>>>>> Hello,
>>>>>> I have a Custom Menu in my GMF diagram with a button "myValidate".
>>>>>> I want this button to run the Validation of the diagram (the same
>>>>>> action as in "Diagram/Validate" menu).
>>>>>>
>>>>>> The problem is that I don't know how to access this IAction from
>>>>>> the Class that handels my menu actions.
>>>>>>
>>>>>> How can I access this action in order to run it ?
>>>>>>
>>>>>> thanks,
>>>>>> regards.
>>>>>> Tex.
Re: run Validation from custom Menu [message #139932 is a reply to message #139849] Wed, 27 June 2007 08:01 Go to previous messageGo to next message
Eclipse UserFriend
Yes there is a static method
runValidation(View view)

But then how can I get tje "view" parameter from a IEditorPart or a
DiagramEditor

thx ,
Tex
Dmitry Stadnik wrote:
> There should be a static method in ValidateAction class to run
> validation; I think it's not necessary to instantiate it.
>
> Tex Twil wrote:
>> ok,
>> I've just found the solution which is quite .... easy :)
>>
>> (editor is a IEditorPart)
>>
>> XXX.diagram.part.ValidateAction validateAction;
>>
>> IWorkbenchPartDescriptor partDescriptor =
>> new WorkbenchPartDescriptor(
>> editor.getSite().getId(),
>> editor.getClass(),
>> editor.getSite().getPage());
>>
>> validateAction = new ValidateAction(partDescriptor);
>> validateAction.run();
>>
>> cheers,
>> Tex.
>>
>>
>> Tex Twil wrote:
>>> Yes,
>>> it's in package XXX.diagram.part.
>>>
>>> I don't know where to get the parameter for the constructor:
>>>
>>> ValidateAction(IWorkbenchPartDescriptor workbenchPartDescriptor)
>>>
>>> Tex.
>>>
>>>
>>> Dmitry Stadnik wrote:
>>>> Now ValidateAction has it's own file.
>>>>
>>>> Tex Twil wrote:
>>>>> Hi,
>>>>> yes that's what I found here :
>>>>> http://dev.eclipse.org/newslists/news.eclipse.modeling.gmf/m sg06307.html
>>>>>
>>>>>
>>>>> but in my XXXValidationProvider class I don't have the static class
>>>>> ValidateAction class.
>>>>>
>>>>> Tex.
>>>>>
>>>>> Khai M Nguyen wrote:
>>>>>> In your generated ...diagram.providers package you should have a
>>>>>> XXXValidationProvider class with a static ValidateAction class
>>>>>> defined in it. From your menu item you can call the static method
>>>>>> ValidateAction.runValidation(view).
>>>>>>
>>>>>> -- Khai --
>>>>>>
>>>>>> Tex Twil wrote:
>>>>>>> Hello,
>>>>>>> I have a Custom Menu in my GMF diagram with a button
>>>>>>> "myValidate". I want this button to run the Validation of the
>>>>>>> diagram (the same action as in "Diagram/Validate" menu).
>>>>>>>
>>>>>>> The problem is that I don't know how to access this IAction from
>>>>>>> the Class that handels my menu actions.
>>>>>>>
>>>>>>> How can I access this action in order to run it ?
>>>>>>>
>>>>>>> thanks,
>>>>>>> regards.
>>>>>>> Tex.
Re: run Validation from custom Menu [message #139964 is a reply to message #139932] Wed, 27 June 2007 08:30 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: 5d5.mail.ru

View is a model of editpart; you may use diagram editpart or editparts
selected on diagram.

Tex Twil wrote:
> Yes there is a static method
> runValidation(View view)
>
> But then how can I get tje "view" parameter from a IEditorPart or a
> DiagramEditor
>
> thx ,
> Tex
> Dmitry Stadnik wrote:
>> There should be a static method in ValidateAction class to run
>> validation; I think it's not necessary to instantiate it.
>>
>> Tex Twil wrote:
>>> ok,
>>> I've just found the solution which is quite .... easy :)
>>>
>>> (editor is a IEditorPart)
>>>
>>> XXX.diagram.part.ValidateAction validateAction;
>>>
>>> IWorkbenchPartDescriptor partDescriptor =
>>> new WorkbenchPartDescriptor(
>>> editor.getSite().getId(),
>>> editor.getClass(),
>>> editor.getSite().getPage());
>>>
>>> validateAction = new ValidateAction(partDescriptor);
>>> validateAction.run();
>>>
>>> cheers,
>>> Tex.
>>>
>>>
>>> Tex Twil wrote:
>>>> Yes,
>>>> it's in package XXX.diagram.part.
>>>>
>>>> I don't know where to get the parameter for the constructor:
>>>>
>>>> ValidateAction(IWorkbenchPartDescriptor workbenchPartDescriptor)
>>>>
>>>> Tex.
>>>>
>>>>
>>>> Dmitry Stadnik wrote:
>>>>> Now ValidateAction has it's own file.
>>>>>
>>>>> Tex Twil wrote:
>>>>>> Hi,
>>>>>> yes that's what I found here :
>>>>>> http://dev.eclipse.org/newslists/news.eclipse.modeling.gmf/m sg06307.html
>>>>>>
>>>>>>
>>>>>> but in my XXXValidationProvider class I don't have the static
>>>>>> class ValidateAction class.
>>>>>>
>>>>>> Tex.
>>>>>>
>>>>>> Khai M Nguyen wrote:
>>>>>>> In your generated ...diagram.providers package you should have a
>>>>>>> XXXValidationProvider class with a static ValidateAction class
>>>>>>> defined in it. From your menu item you can call the static
>>>>>>> method ValidateAction.runValidation(view).
>>>>>>>
>>>>>>> -- Khai --
>>>>>>>
>>>>>>> Tex Twil wrote:
>>>>>>>> Hello,
>>>>>>>> I have a Custom Menu in my GMF diagram with a button
>>>>>>>> "myValidate". I want this button to run the Validation of the
>>>>>>>> diagram (the same action as in "Diagram/Validate" menu).
>>>>>>>>
>>>>>>>> The problem is that I don't know how to access this IAction from
>>>>>>>> the Class that handels my menu actions.
>>>>>>>>
>>>>>>>> How can I access this action in order to run it ?
>>>>>>>>
>>>>>>>> thanks,
>>>>>>>> regards.
>>>>>>>> Tex.
Re: run Validation from custom Menu [message #139991 is a reply to message #139964] Wed, 27 June 2007 09:24 Go to previous message
Eclipse UserFriend
Ok, thank you very much. This helped me also for my other post about
validating while saving the diagram.

thx,
Tex.
Dmitry Stadnik wrote:
> View is a model of editpart; you may use diagram editpart or editparts
> selected on diagram.
>
> Tex Twil wrote:
>> Yes there is a static method
>> runValidation(View view)
>>
>> But then how can I get tje "view" parameter from a IEditorPart or a
>> DiagramEditor
>>
>> thx ,
>> Tex
>> Dmitry Stadnik wrote:
>>> There should be a static method in ValidateAction class to run
>>> validation; I think it's not necessary to instantiate it.
>>>
>>> Tex Twil wrote:
>>>> ok,
>>>> I've just found the solution which is quite .... easy :)
>>>>
>>>> (editor is a IEditorPart)
>>>>
>>>> XXX.diagram.part.ValidateAction validateAction;
>>>>
>>>> IWorkbenchPartDescriptor partDescriptor =
>>>> new WorkbenchPartDescriptor(
>>>> editor.getSite().getId(),
>>>> editor.getClass(),
>>>> editor.getSite().getPage());
>>>>
>>>> validateAction = new ValidateAction(partDescriptor);
>>>> validateAction.run();
>>>>
>>>> cheers,
>>>> Tex.
>>>>
>>>>
>>>> Tex Twil wrote:
>>>>> Yes,
>>>>> it's in package XXX.diagram.part.
>>>>>
>>>>> I don't know where to get the parameter for the constructor:
>>>>>
>>>>> ValidateAction(IWorkbenchPartDescriptor workbenchPartDescriptor)
>>>>>
>>>>> Tex.
>>>>>
>>>>>
>>>>> Dmitry Stadnik wrote:
>>>>>> Now ValidateAction has it's own file.
>>>>>>
>>>>>> Tex Twil wrote:
>>>>>>> Hi,
>>>>>>> yes that's what I found here :
>>>>>>> http://dev.eclipse.org/newslists/news.eclipse.modeling.gmf/m sg06307.html
>>>>>>>
>>>>>>>
>>>>>>> but in my XXXValidationProvider class I don't have the static
>>>>>>> class ValidateAction class.
>>>>>>>
>>>>>>> Tex.
>>>>>>>
>>>>>>> Khai M Nguyen wrote:
>>>>>>>> In your generated ...diagram.providers package you should have a
>>>>>>>> XXXValidationProvider class with a static ValidateAction class
>>>>>>>> defined in it. From your menu item you can call the static
>>>>>>>> method ValidateAction.runValidation(view).
>>>>>>>>
>>>>>>>> -- Khai --
>>>>>>>>
>>>>>>>> Tex Twil wrote:
>>>>>>>>> Hello,
>>>>>>>>> I have a Custom Menu in my GMF diagram with a button
>>>>>>>>> "myValidate". I want this button to run the Validation of the
>>>>>>>>> diagram (the same action as in "Diagram/Validate" menu).
>>>>>>>>>
>>>>>>>>> The problem is that I don't know how to access this IAction
>>>>>>>>> from the Class that handels my menu actions.
>>>>>>>>>
>>>>>>>>> How can I access this action in order to run it ?
>>>>>>>>>
>>>>>>>>> thanks,
>>>>>>>>> regards.
>>>>>>>>> Tex.
Previous Topic:Taipan: Where are the models?
Next Topic:How can I complete a refresh after the call of handleMajorSemanticChange?
Goto Forum:
  


Current Time: Fri Apr 11 22:53:44 EDT 2025

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

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

Back to the top