|
|
|
|
|
Re: Break points for code generating [message #84356 is a reply to message #84271] |
Mon, 21 March 2005 23:41 |
Srimanth Messages: 225 Registered: July 2009 |
Senior Member |
|
|
Hi Elena,
Codegen simply generates whatever PTExpression is set in the allocation
feature of the bean. If you keep a breakpoint at
CompositeContainerPolicy.createInitStringCommand(), you can observe the
creation of the PTExpression for the default pattern of 'new
<someSWTClass>(<someParent>, org.eclipse.swt.SWT.NONE)' - Button, Label
etc. use this pattern.
However if you would like to have customization (something which might
interest you) to the constructor (like CheckBox), where the constructor
is different that the above mentioned - like 'new
org.eclipse.swt.widgets.Button(<someParent>,
org.eclipse.swt.SWT.CHECK)', you can specify in the override file itself
(look at org.eclipse.ve.swt\CheckBox.xmi for the element '<allocation
xsi:type="org.eclipse.jem.internal.instantiation:ParseTreeAllocation ">')
what the allocation should look like - and the editpolicy (via command
CompositeContainerPolicy.EnsureCorrectParentCommand) will fill in the
allocation. Keep a breakpoint at EnsureCorrectParentCommand.execute() to
see how this is done. Hope this helps in your implementation.
Regards,
Sri.
Elena wrote:
> Yes, my question is responsible for generating the PTExpression when the
> class is dropped from the palette. I had a look at all classes that you
> have mentioned but have not found a solution yet :-(.
> How can I change the "allocation" for my class? Or could you give me one
> more tips please :o)
>
> Many thanks in advance
> Elena
>
>
>
|
|
|
Re: Break points for code generating [message #84370 is a reply to message #84356] |
Mon, 21 March 2005 23:51 |
Srimanth Messages: 225 Registered: July 2009 |
Senior Member |
|
|
Small correction - org.eclipse.ve.swt\CheckBox.xmi is the file which
represents the CheckBox Palette Entry in the palette. It is not the
override file. It is a palette entry of type EMFPrototypeToolEntry,
where you can customize which ParseTreeAllocation to use.
So, if you wanted to have a palette entry for a bean called FooBar and
when dropped, create a constructor 'new FooBar(Foo.foo, new Bar())' -
you would create a EMFPrototypeToolEntry entry for FooBar, and then in
the FooBar.xmi, specify the ParseTreeAllocation for the custom
constructor you have above.
Regards,
Sri.
Sri Gunturi wrote:
> Hi Elena,
> Codegen simply generates whatever PTExpression is set in the
> allocation feature of the bean. If you keep a breakpoint at
> CompositeContainerPolicy.createInitStringCommand(), you can observe the
> creation of the PTExpression for the default pattern of 'new
> <someSWTClass>(<someParent>, org.eclipse.swt.SWT.NONE)' - Button, Label
> etc. use this pattern.
>
> However if you would like to have customization (something which might
> interest you) to the constructor (like CheckBox), where the constructor
> is different that the above mentioned - like 'new
> org.eclipse.swt.widgets.Button(<someParent>,
> org.eclipse.swt.SWT.CHECK)', you can specify in the override file itself
> (look at org.eclipse.ve.swt\CheckBox.xmi for the element '<allocation
> xsi:type="org.eclipse.jem.internal.instantiation:ParseTreeAllocation ">')
> what the allocation should look like - and the editpolicy (via command
> CompositeContainerPolicy.EnsureCorrectParentCommand) will fill in the
> allocation. Keep a breakpoint at EnsureCorrectParentCommand.execute() to
> see how this is done. Hope this helps in your implementation.
> Regards,
> Sri.
>
>
>
>
> Elena wrote:
>
>> Yes, my question is responsible for generating the PTExpression when
>> the class is dropped from the palette. I had a look at all classes
>> that you have mentioned but have not found a solution yet :-(.
>> How can I change the "allocation" for my class? Or could you give me
>> one more tips please :o)
>>
>> Many thanks in advance
>> Elena
>>
>>
>>
|
|
|
|
|
|
|
|
|
Re: Break points for code generating [message #605983 is a reply to message #84271] |
Mon, 21 March 2005 23:41 |
Srimanth Messages: 225 Registered: July 2009 |
Senior Member |
|
|
Hi Elena,
Codegen simply generates whatever PTExpression is set in the allocation
feature of the bean. If you keep a breakpoint at
CompositeContainerPolicy.createInitStringCommand(), you can observe the
creation of the PTExpression for the default pattern of 'new
<someSWTClass>(<someParent>, org.eclipse.swt.SWT.NONE)' - Button, Label
etc. use this pattern.
However if you would like to have customization (something which might
interest you) to the constructor (like CheckBox), where the constructor
is different that the above mentioned - like 'new
org.eclipse.swt.widgets.Button(<someParent>,
org.eclipse.swt.SWT.CHECK)', you can specify in the override file itself
(look at org.eclipse.ve.swt\CheckBox.xmi for the element '<allocation
xsi:type="org.eclipse.jem.internal.instantiation:ParseTreeAllocation ">')
what the allocation should look like - and the editpolicy (via command
CompositeContainerPolicy.EnsureCorrectParentCommand) will fill in the
allocation. Keep a breakpoint at EnsureCorrectParentCommand.execute() to
see how this is done. Hope this helps in your implementation.
Regards,
Sri.
Elena wrote:
> Yes, my question is responsible for generating the PTExpression when the
> class is dropped from the palette. I had a look at all classes that you
> have mentioned but have not found a solution yet :-(.
> How can I change the "allocation" for my class? Or could you give me one
> more tips please :o)
>
> Many thanks in advance
> Elena
>
>
>
|
|
|
Re: Break points for code generating [message #605986 is a reply to message #84356] |
Mon, 21 March 2005 23:51 |
Srimanth Messages: 225 Registered: July 2009 |
Senior Member |
|
|
Small correction - org.eclipse.ve.swt\CheckBox.xmi is the file which
represents the CheckBox Palette Entry in the palette. It is not the
override file. It is a palette entry of type EMFPrototypeToolEntry,
where you can customize which ParseTreeAllocation to use.
So, if you wanted to have a palette entry for a bean called FooBar and
when dropped, create a constructor 'new FooBar(Foo.foo, new Bar())' -
you would create a EMFPrototypeToolEntry entry for FooBar, and then in
the FooBar.xmi, specify the ParseTreeAllocation for the custom
constructor you have above.
Regards,
Sri.
Sri Gunturi wrote:
> Hi Elena,
> Codegen simply generates whatever PTExpression is set in the
> allocation feature of the bean. If you keep a breakpoint at
> CompositeContainerPolicy.createInitStringCommand(), you can observe the
> creation of the PTExpression for the default pattern of 'new
> <someSWTClass>(<someParent>, org.eclipse.swt.SWT.NONE)' - Button, Label
> etc. use this pattern.
>
> However if you would like to have customization (something which might
> interest you) to the constructor (like CheckBox), where the constructor
> is different that the above mentioned - like 'new
> org.eclipse.swt.widgets.Button(<someParent>,
> org.eclipse.swt.SWT.CHECK)', you can specify in the override file itself
> (look at org.eclipse.ve.swt\CheckBox.xmi for the element '<allocation
> xsi:type="org.eclipse.jem.internal.instantiation:ParseTreeAllocation ">')
> what the allocation should look like - and the editpolicy (via command
> CompositeContainerPolicy.EnsureCorrectParentCommand) will fill in the
> allocation. Keep a breakpoint at EnsureCorrectParentCommand.execute() to
> see how this is done. Hope this helps in your implementation.
> Regards,
> Sri.
>
>
>
>
> Elena wrote:
>
>> Yes, my question is responsible for generating the PTExpression when
>> the class is dropped from the palette. I had a look at all classes
>> that you have mentioned but have not found a solution yet :-(.
>> How can I change the "allocation" for my class? Or could you give me
>> one more tips please :o)
>>
>> Many thanks in advance
>> Elena
>>
>>
>>
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.05674 seconds