use of org.obeonetwork.dsl.statemachine.FinalState in project InformationSystem by ObeoNetwork.
the class FinalStateFinalStatePropertiesEditionComponent method initPart.
/**
* {@inheritDoc}
*
* @see org.eclipse.emf.eef.runtime.api.component.IPropertiesEditionComponent#initPart(java.lang.Object, int, org.eclipse.emf.ecore.EObject,
* org.eclipse.emf.ecore.resource.ResourceSet)
*/
public void initPart(Object key, int kind, EObject elt, ResourceSet allResource) {
setInitializing(true);
if (editingPart != null && key == partKey) {
editingPart.setContext(elt, allResource);
final FinalState finalState = (FinalState) elt;
final FinalStatePropertiesEditionPart finalStatePart = (FinalStatePropertiesEditionPart) editingPart;
// init values
if (isAccessible(StatemachineViewsRepository.FinalState.Properties.description))
finalStatePart.setDescription(EEFConverterUtil.convertToString(EcorePackage.Literals.ESTRING, finalState.getDescription()));
if (isAccessible(StatemachineViewsRepository.FinalState.Properties.keywords))
finalStatePart.setKeywords(finalState.getKeywords());
if (isAccessible(StatemachineViewsRepository.FinalState.Properties.incomingTransitions)) {
incomingTransitionsSettings = new ReferencesTableSettings(finalState, StateMachinePackage.eINSTANCE.getAbstractState_IncomingTransitions());
finalStatePart.initIncomingTransitions(incomingTransitionsSettings);
}
if (isAccessible(StatemachineViewsRepository.FinalState.Properties.outcomingTransitions)) {
outcomingTransitionsSettings = new ReferencesTableSettings(finalState, StateMachinePackage.eINSTANCE.getAbstractState_OutcomingTransitions());
finalStatePart.initOutcomingTransitions(outcomingTransitionsSettings);
}
if (isAccessible(StatemachineViewsRepository.FinalState.Properties.incomingTransitions)) {
finalStatePart.addFilterToIncomingTransitions(new EObjectFilter(StateMachinePackage.Literals.TRANSITION));
// Start of user code for additional businessfilters for incomingTransitions
// End of user code
}
if (isAccessible(StatemachineViewsRepository.FinalState.Properties.outcomingTransitions)) {
finalStatePart.addFilterToOutcomingTransitions(new EObjectFilter(StateMachinePackage.Literals.TRANSITION));
// Start of user code for additional businessfilters for outcomingTransitions
// End of user code
}
// init values for referenced views
// init filters for referenced views
}
setInitializing(false);
}
use of org.obeonetwork.dsl.statemachine.FinalState in project InformationSystem by ObeoNetwork.
the class FinalStateFinalStatePropertiesEditionComponent method updateSemanticModel.
/**
* {@inheritDoc}
* @see org.eclipse.emf.eef.runtime.impl.components.StandardPropertiesEditionComponent#updateSemanticModel(org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionEvent)
*/
public void updateSemanticModel(final IPropertiesEditionEvent event) {
FinalState finalState = (FinalState) semanticObject;
if (StatemachineViewsRepository.FinalState.Properties.description == event.getAffectedEditor()) {
finalState.setDescription((java.lang.String) EEFConverterUtil.createFromString(EcorePackage.Literals.ESTRING, (String) event.getNewValue()));
}
if (StatemachineViewsRepository.FinalState.Properties.keywords == event.getAffectedEditor()) {
if (event.getKind() == PropertiesEditionEvent.SET) {
finalState.getKeywords().clear();
finalState.getKeywords().addAll(((EList) event.getNewValue()));
}
}
if (StatemachineViewsRepository.FinalState.Properties.incomingTransitions == event.getAffectedEditor()) {
if (event.getKind() == PropertiesEditionEvent.ADD) {
if (event.getNewValue() instanceof Transition) {
incomingTransitionsSettings.addToReference((EObject) event.getNewValue());
}
} else if (event.getKind() == PropertiesEditionEvent.REMOVE) {
incomingTransitionsSettings.removeFromReference((EObject) event.getNewValue());
} else if (event.getKind() == PropertiesEditionEvent.MOVE) {
incomingTransitionsSettings.move(event.getNewIndex(), (Transition) event.getNewValue());
}
}
if (StatemachineViewsRepository.FinalState.Properties.outcomingTransitions == event.getAffectedEditor()) {
if (event.getKind() == PropertiesEditionEvent.ADD) {
if (event.getNewValue() instanceof Transition) {
outcomingTransitionsSettings.addToReference((EObject) event.getNewValue());
}
} else if (event.getKind() == PropertiesEditionEvent.REMOVE) {
outcomingTransitionsSettings.removeFromReference((EObject) event.getNewValue());
} else if (event.getKind() == PropertiesEditionEvent.MOVE) {
outcomingTransitionsSettings.move(event.getNewIndex(), (Transition) event.getNewValue());
}
}
}
Aggregations