Date post: | 21-Mar-2017 |
Category: |
Technology |
Upload: | superpippohw |
View: | 431 times |
Download: | 0 times |
© Copyright IBM Corporation 2007
A Summary of SAT Accumulation
Proving SOA & Asset Reuse work with IBM’s Globally Integrated Enterprise Strategy
Authors: Huang Wei
© Copyright IBM Corporation 2007https://w3.webahead.ibm.com/w3ki/display/GBSC/Global+Business+Solution+Center
GBSC – GBS Asset Management GCG @ China Development Lab
Agenda
1. CBM extension- 1.1 Customize the Tabview- 1.2 Modify the CBM model
2. CNF extension- 2.1 objectContribution- 2.2 viewContribution- 2.3 actionProvider
3. EMF related
4. SWT/JFace & Plugin related
© Copyright IBM Corporation 2007https://w3.webahead.ibm.com/w3ki/display/GBSC/Global+Business+Solution+Center
GBSC – GBS Asset Management GCG @ China Development Lab
1.1 CBM extension - Customize the Tabview
Now, CBM tool supplies with an extension point called com.ibm.almaden.asr.cbm.activities.activity (in the final release may be a more general one)- Extend it to override the content of the Activity Tabview
© Copyright IBM Corporation 2007https://w3.webahead.ibm.com/w3ki/display/GBSC/Global+Business+Solution+Center
GBSC – GBS Asset Management GCG @ China Development Lab
1.1 CBM extension - Customize the Tabview
© Copyright IBM Corporation 2007https://w3.webahead.ibm.com/w3ki/display/GBSC/Global+Business+Solution+Center
GBSC – GBS Asset Management GCG @ China Development Lab
1.2 CBM extension – Modify the CBM model
Now we can modify the existing element of CBM model(e.g. modify a component, delete a component).
Besides, we can also add our own element to CBM model(e.g. add a Function Set, add a Function Item under Function Set).
© Copyright IBM Corporation 2007https://w3.webahead.ibm.com/w3ki/display/GBSC/Global+Business+Solution+Center
GBSC – GBS Asset Management GCG @ China Development Lab
2. CNF extension
CNF extension here means the left navigator viewer extension. The CBM tool has hooked some content on the viewer.
Now we have our own model (in the future will be the SAT model).So with the help of CNF, we can also hook what we want on it.e.g. we add some function sets under the enterprise element.
© Copyright IBM Corporation 2007https://w3.webahead.ibm.com/w3ki/display/GBSC/Global+Business+Solution+Center
GBSC – GBS Asset Management GCG @ China Development Lab
2.1 CNF extension – objectContribution
objectContribution means contribution to a single object We specify the object target class in the plugin.xml
<objectContribution
adaptable="false"
id="com.ibm.test.testcbm.actions.ActivityCreateAction"
objectClass="com.ibm.almaden.asr.cbm.metamodel.BusinessComponent">
<action
class="com.ibm.test.testcbm.actions.ActivityCreateAction"
enablesFor="1"
icon="eclipse-icons/add_att(1).gif"
id="ActivityMenu"
label="Create an activity"
tooltip="create it"/>
</objectContribution>
© Copyright IBM Corporation 2007https://w3.webahead.ibm.com/w3ki/display/GBSC/Global+Business+Solution+Center
GBSC – GBS Asset Management GCG @ China Development Lab
2.1 CNF extension – objectContribution
If it’s under the popupMenu extension point, it should be like this:
© Copyright IBM Corporation 2007https://w3.webahead.ibm.com/w3ki/display/GBSC/Global+Business+Solution+Center
GBSC – GBS Asset Management GCG @ China Development Lab
2.2 CNF extension – viewContribution
viewContribution means contribution to a viewerwe can hook some action to the toolbar or triangle button of the view
© Copyright IBM Corporation 2007https://w3.webahead.ibm.com/w3ki/display/GBSC/Global+Business+Solution+Center
GBSC – GBS Asset Management GCG @ China Development Lab
2.3 CNF extension – actionProvider
actionProvider means if you select one element in the navigator view, then you can hook actions action (e.g. double-click the element) and contextMenu on it.
In the plugin.xml, define an actionProvider under org.eclipse.ui.navigator.navigatorContent point,then define the matching viewerActionBinding under org.eclipse.ui.navigator.viewer, included by the instance of com.ibm.almaden.asr.navigator.view.CBMCommonNavigator
© Copyright IBM Corporation 2007https://w3.webahead.ibm.com/w3ki/display/GBSC/Global+Business+Solution+Center
GBSC – GBS Asset Management GCG @ China Development Lab
2.3 CNF extension – actionProvider
© Copyright IBM Corporation 2007https://w3.webahead.ibm.com/w3ki/display/GBSC/Global+Business+Solution+Center
GBSC – GBS Asset Management GCG @ China Development Lab
3. EMF related
As we know, no matter which way (in the navigator tree or in the table of tabview) to show the model, we should give a contentProvider and a labelProvider.
However, if we implement the original JFace I**Provider, the notification should be handled by ourselves. That’s a trouble when facing changes.
So, we can use the provider code generated by EMF genmodel. Each model element has its ItemProvider. And with the help of **TestcbmItemProviderAdapterFactory (it is an adapter), we can adapt the I**ItemProvider hierarchy of EMF to the I**Provider hierarchy of JFace.
© Copyright IBM Corporation 2007https://w3.webahead.ibm.com/w3ki/display/GBSC/Global+Business+Solution+Center
GBSC – GBS Asset Management GCG @ China Development Lab
3. EMF related
Not generated
Adapter
Ref: http://www.cnblogs.com/bjzhanghao/articles/324909.html
© Copyright IBM Corporation 2007https://w3.webahead.ibm.com/w3ki/display/GBSC/Global+Business+Solution+Center
GBSC – GBS Asset Management GCG @ China Development Lab
4. SWT/JFace & Plugin related
FormLayout- Use this layout style as a principle (it’s really convenient)
Section- Use toolkit.create** method to create a widget- Otherwise, if using “new” to create, you have to invoke the toolkit.adapt method to en
sure section and the widget has the consistent style CBMEditingDomain.INSTANCE.runAsWrite
- Control the scope of the thread code the less the better **EditorInput.equals
- Override this method, so that an object has its single editor@Override
public boolean equals(Object arg0) {
if (arg0 instanceof MyElementEditorInput) {
MyElementEditorInput input = (MyElementEditorInput) arg0;
if (input.getModel() == this.getModel())
return true;
}
return false;
} //~MyElementEditorInput.java
© Copyright IBM Corporation 2007https://w3.webahead.ibm.com/w3ki/display/GBSC/Global+Business+Solution+Center
GBSC – GBS Asset Management GCG @ China Development Lab
4. SWT/JFace & Plugin related
“Monkey See Monkey Do”- Eclipse CVS examples
Host: dev.eclipse.org Repository Path: /cvsroot/eclipse, /cvsroot/modeling, /cvsroot/tools
- CBM tool itself Refresh Problems
- Ensure the **Provider is able to notify the propertyChangeEvent- 2 examples till now
Navigator tree Activity tabview