| How do I "overload" an already existing EditHelper? [message #114613] | 
Tue, 27 March 2007 08:06   | 
 
Eclipse User  | 
 | 
 | 
   | 
 
Hello, 
 
I have a custom project for my generated GMF-editor. As my custom-plugin 
expands functionality I want to add new commands that are retrieved by 
the EditHelper. 
 
How do I override the already generated EditHelper. I played around with 
the type extension points, but did not recieve the desired result so 
far. I've set a break point in my new EditHelper but it is not called. 
 
Greetings, 
Alexander
 |  
 |  
  | 
| Re: How do I "overload" an already existing EditHelper? [message #114663 is a reply to message #114613] | 
Tue, 27 March 2007 08:35    | 
 
Eclipse User  | 
 | 
 | 
   | 
 
Alexander, 
 
You can augment the command returned by an EditHelper by binding an  
IEditHelperAdvice to its element type using an adviceBinding element in  
the elementTypes extension point.  This will result in a composite  
command that contains both the command from the EditHelper in your  
generated editor plugin _and_ the command from your IEditHelperAdvice. 
 
If you wish to completely _replace_ the command from the EditHelper, you  
can set the REPLACE_DEFAULT_COMMAND parameter from your  
IEditHelperAdvice, like this: 
 
 request.setParameter(IEditCommandRequest.REPLACE_DEFAULT_COM MAND, 
				Boolean.TRUE); 
 
There is an example of this in the  
HalfAdderAdvice#getBeforeConfigureCommand in the runtime logic example.  
  In this example the advice is contributed by a specializationType  
element in the elementTypes extension point because the half adder is a  
type in its own right, but the same idea applies when you're using the  
adviceBinding element. 
 
Hope that helps, 
Linda 
 
 
 
Alexander Dotor wrote: 
> Hello, 
>  
> I have a custom project for my generated GMF-editor. As my custom-plugin 
> expands functionality I want to add new commands that are retrieved by 
> the EditHelper. 
>  
> How do I override the already generated EditHelper. I played around with 
> the type extension points, but did not recieve the desired result so 
> far. I've set a break point in my new EditHelper but it is not called. 
>  
> Greetings, 
> Alexander
 |  
 |  
  | 
 | 
Powered by 
FUDForum. Page generated in 0.03500 seconds