You can customize your user interface like shown below. For more samples please refer to the Logo tutorial (chapter 9 : UI Improvement).
Generated code can be modified for customization. An EMF editor for FSM models is ever deployed into Eclipse Kermeta. Retrieve the plugin code source with File -> Import -> Plug-in Development -> Plug-ins and Fragments and click two times on Next. Then choose the following plugins :
The plugin .model, .edit and .editor correspond to the fsm EMF editor whereas the .graphicalEditor represents the Topcased editor.
![]() | Add custom code |
|---|---|
To keep your customized code for each generation you need to add
/**
*
* @generated NOT
*/
just before the name of the method you want to customize. |
To change an icon you need only to replace the icon from fr.triskell.kermeta.samples.fsm.edit/icons/full/obj16 to another with the same name and the same extension. It is the case on this deployed plugin. The following image presents this plugin, the .gif images have been changed from the initial EMF generation.
Respectively the icons FSM.gif, State.gif and Transition.gif look like this :
![]() | Note |
|---|---|
Like GMF use EMF icons for the palette you can customize the palette icons by this way. |
You will see the change when you will use the generated editor like in the following section.
The following method comes from FSMItemProvider in the package fr.triskell.kermeta.samples.fsm.provider in the project fr.irisa.triskell.kermeta.samples.fsm.model.edit. It permits to disply thr initial state or if it is missing or if the final state is missing.
/**
* This returns the label text for the adapted class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated NOT
*/
public String getText(Object object) {
String initialState = " [an initial state is required]";
if(object instanceof FSM && ((FSM) object).getInitialState()!=null) {
initialState = " [initial state = " + ((FSM) object).getInitialState().getName() + "]";
}
String finalState = " - [at least one final state is required]";
if(object instanceof FSM && ((FSM) object).getFinalState().size()>0 ) {
finalState = "";
}
return getString("_UI_FSM_type") + initialState + finalState;
}
.