Bug 236221 - Enhance add new binding children
Summary: Enhance add new binding children
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Sca (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Stephane Drapeau CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2008-06-09 05:44 EDT by Norihiro Kubo CLA
Modified: 2017-03-30 14:20 EDT (History)
3 users (show)

See Also:


Attachments
Patch file (1.04 MB, patch)
2008-06-09 05:44 EDT, Norihiro Kubo CLA
Stephane.Drapeau: iplog+
Details | Diff
ActualDiff (15.04 KB, application/octet-stream)
2008-06-09 05:46 EDT, Norihiro Kubo CLA
no flags Details
BindingFoo (85.27 KB, application/octet-stream)
2008-06-09 05:47 EDT, Norihiro Kubo CLA
no flags Details
screenshot (5.75 KB, image/gif)
2008-06-09 05:48 EDT, Norihiro Kubo CLA
no flags Details
bindings extension and sample (37.42 KB, application/octet-stream)
2008-06-09 22:16 EDT, Norihiro Kubo CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Norihiro Kubo CLA 2008-06-09 05:44:03 EDT
Created attachment 104131 [details]
Patch file

I would like to add new bindings (e.g. <foo:binding.foo />). Because I defined new binding in my project.

I wish we will be able to add binding children in our projects.
I taked following steps to do it.

1)modified sca.genmodel to allow extensible.
(http://ed-merks.blogspot.com/2008/01/creating-children-you-didnt-know.html)
I modified only one parameter.  
And generate code again with sca.genmodel.

2)add export package
org.eclipse.stp.sca.diagram.edit.policies package is added to export package in org.eclipse.sca.stp.diagram/plugin.xml to extend policy classes in other projects.


3)define new extension point to load AdaptorFactory class.
Diagram Editor needs AdaptorFactory for added binding domain.
It's working in org.eclipse.stp.sca.diagram.part.SCADiagramEditorPluginEx.

I attached the patch.
There are many difference in patch, But almost difference is generated by EMF generator.
You can apply the patch along the following lines from this file.
1) Overwrite existing files with files in the patch. 
2) Generate files from sca.genmodel with EMF Generator.


And I attached sample program to add new binding Foo.(BindingFoo)

Key point of this sample are

1) define new binding in eore file in foo.ecore

2) write EditPart, Command and etc as usual in diagram project.

3) Add AdapotorFactory with extension point org.eclipse.stp.sca.diagram.AdaptorFactories in plugin.xml of diagram projects

Regards,
Norihiro Kubo
Comment 1 Norihiro Kubo CLA 2008-06-09 05:46:23 EDT
Created attachment 104132 [details]
ActualDiff

> You can apply the patch along the following lines from this file.
"this file" is ActualDiff.
Comment 2 Norihiro Kubo CLA 2008-06-09 05:47:44 EDT
Created attachment 104133 [details]
BindingFoo
Comment 3 Norihiro Kubo CLA 2008-06-09 05:48:25 EDT
Created attachment 104135 [details]
screenshot
Comment 4 Norihiro Kubo CLA 2008-06-09 22:16:11 EDT
Created attachment 104251 [details]
bindings extension and sample

Hi,

I attached bindings extension and sample for it.

I defined "bindings" extension point in org.eclipse.stp.sca.diagram.binding.

This extension generate EditPart, Command ant etc.
I mean we can add binding to write extension in plugin.xml:

   <extension point="org.eclipse.stp.sca.diagram.binding.bindings">
   		<binding typeId="org.example.foo.diagram.FooBinding"
   		 literalClass="org.example.foo.FooPackage$Literals"
   		 literalField="DOCUMENT_ROOT__BINDING_FOO" 
   		 iconPath="/org.example.foo.binding/icons/obj16/FooBinding.gif" />
   </extension>

org.example.foo.binding plugin is sample for FooBinding.
If you try this sample, please uninstall org.example.foo.diagram.

I think this mechanism is applicable to implemantation and interface.
Comment 5 Stephane Drapeau CLA 2008-08-04 08:21:57 EDT
Hi Norihiro,

I tested your contribution. It's wonderful :)
I added the new binding in the palette, and I'm implementing the same thing for the implementations and the interfaces.
I'm also using this approach to have specific plugins for the Tuscany elements (and then for Frascati, Newton and Fabric3).

Because your contribution is important, I would like to open an IPBugZilla. For this, I would like to submit only the not generated code:  genmodel + org.eclipse.stp.sca.diagram.binding
Are you agree?

Moreover, you need to make the following confirmations:
a. Confirm you authored 100% of the code
b. Confirm you have the rights to donate the code to Eclipse
c. Confirm you are submitting the code for inclusion in future Eclipse releases under the EPL
d. Number of line of code

As your employer is IONA, I think that you must send also an Employer Consent Form from the Employer [http://www.eclipse.org/projects/dev_process/new-committer.php]

Would you like to be committer on the SCA Tools project? I would like to propose you for your valuable contribution.
Comment 6 Norihiro Kubo CLA 2008-08-05 22:25:09 EDT
I'm happy to contribute the project. :)

> this, I would like to submit only the not generated code:  genmodel +
> org.eclipse.stp.sca.diagram.binding
> Are you agree?

Yes, I agree.

> Moreover, you need to make the following confirmations:
> a. Confirm you authored 100% of the code
> b. Confirm you have the rights to donate the code to Eclipse
> c. Confirm you are submitting the code for inclusion in future Eclipse releases
> under the EPL
> d. Number of line of code

a, b and c are OK.
Waht does "Number of line of code" mean ?
Comment 7 Stephane Drapeau CLA 2008-08-11 04:18:38 EDT
(In reply to comment #6)
> Waht does "Number of line of code" mean ?
> 

Number of lines of java code (LoC) that you wrote.
You can use the Checkstyle plugin for counting the number of lines: http://eclipse-cs.sourceforge.net/
Comment 8 Stephane Drapeau CLA 2008-08-11 04:41:21 EDT
I opened a IPZilla bug: https://dev.eclipse.org/ipzilla/show_bug.cgi?id=2575
Comment 9 Norihiro Kubo CLA 2008-08-11 21:30:15 EDT
(In reply to comment #7)
> Number of lines of java code (LoC) that you wrote.


Okay.

The LoC is 1568 in org.eclipse.stp.sca.diagram.bindings.
I counted lines with Metrics 1.3.6 (http://metrics.sourceforge.net/).


Comment 10 Stephane Drapeau CLA 2008-10-07 10:23:24 EDT
Commit #2611
Comment 11 Vincent Zurczak CLA 2011-03-25 08:45:01 EDT
Close old bugs.
Comment 12 dounia sahbi CLA 2016-03-31 16:42:21 EDT
hi i didnt understand how to add new element in the diagram pleaz can you explain more ?
Comment 13 dounia sahbi CLA 2016-03-31 16:43:38 EDT
(In reply to Stephane Drapeau from comment #5)
> Hi Norihiro,
> 
> I tested your contribution. It's wonderful :)
> I added the new binding in the palette, and I'm implementing the same thing
> for the implementations and the interfaces.
> I'm also using this approach to have specific plugins for the Tuscany
> elements (and then for Frascati, Newton and Fabric3).
> 
> Because your contribution is important, I would like to open an IPBugZilla.
> For this, I would like to submit only the not generated code:  genmodel +
> org.eclipse.stp.sca.diagram.binding
> Are you agree?
> 
> Moreover, you need to make the following confirmations:
> a. Confirm you authored 100% of the code
> b. Confirm you have the rights to donate the code to Eclipse
> c. Confirm you are submitting the code for inclusion in future Eclipse
> releases under the EPL
> d. Number of line of code
> 
> As your employer is IONA, I think that you must send also an Employer
> Consent Form from the Employer
> [http://www.eclipse.org/projects/dev_process/new-committer.php]
> 
> Would you like to be committer on the SCA Tools project? I would like to
> propose you for your valuable contribution.

can you explain more plzz ?