Search in sources :

Example 1 with UserAction

use of org.obeonetwork.graal.UserAction in project InformationSystem by ObeoNetwork.

the class UserActionUserActionPropertiesEditionComponent 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 UserAction userAction = (UserAction) elt;
        final UserActionPropertiesEditionPart userActionPart = (UserActionPropertiesEditionPart) editingPart;
        // init values
        if (isAccessible(GraalViewsRepository.UserAction.Properties.description))
            userActionPart.setDescription(EcoreUtil.convertToString(EcorePackage.Literals.ESTRING, userAction.getDescription()));
        if (isAccessible(GraalViewsRepository.UserAction.Properties.name))
            userActionPart.setName(EEFConverterUtil.convertToString(EcorePackage.Literals.ESTRING, userAction.getName()));
        if (isAccessible(GraalViewsRepository.UserAction.Properties.outgoingTransitions)) {
            outgoingTransitionsSettings = new ReferencesTableSettings(userAction, GraalPackage.eINSTANCE.getNode_OutgoingTransitions());
            userActionPart.initOutgoingTransitions(outgoingTransitionsSettings);
        }
        if (isAccessible(GraalViewsRepository.UserAction.Properties.incomingTransitions)) {
            incomingTransitionsSettings = new ReferencesTableSettings(userAction, GraalPackage.eINSTANCE.getNode_IncomingTransitions());
            userActionPart.initIncomingTransitions(incomingTransitionsSettings);
        }
        if (isAccessible(GraalViewsRepository.UserAction.Properties.outgoingTransitions)) {
            userActionPart.addFilterToOutgoingTransitions(new EObjectFilter(GraalPackage.Literals.TRANSITION));
        // Start of user code for additional businessfilters for outgoingTransitions
        // End of user code
        }
        if (isAccessible(GraalViewsRepository.UserAction.Properties.incomingTransitions)) {
            userActionPart.addFilterToIncomingTransitions(new EObjectFilter(GraalPackage.Literals.TRANSITION));
        // Start of user code for additional businessfilters for incomingTransitions
        // End of user code
        }
    // init values for referenced views
    // init filters for referenced views
    }
    setInitializing(false);
}
Also used : UserAction(org.obeonetwork.graal.UserAction) EObjectFilter(org.eclipse.emf.eef.runtime.impl.filters.EObjectFilter) UserActionPropertiesEditionPart(org.obeonetwork.graal.parts.UserActionPropertiesEditionPart) ReferencesTableSettings(org.eclipse.emf.eef.runtime.ui.widgets.referencestable.ReferencesTableSettings)

Aggregations

EObjectFilter (org.eclipse.emf.eef.runtime.impl.filters.EObjectFilter)1 ReferencesTableSettings (org.eclipse.emf.eef.runtime.ui.widgets.referencestable.ReferencesTableSettings)1 UserAction (org.obeonetwork.graal.UserAction)1 UserActionPropertiesEditionPart (org.obeonetwork.graal.parts.UserActionPropertiesEditionPart)1