Search in sources :

Example 1 with Operator

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

the class OperatorOperatorPropertiesEditionComponent 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 Operator operator = (Operator) elt;
        final OperatorPropertiesEditionPart operatorPart = (OperatorPropertiesEditionPart) editingPart;
        // init values
        if (isAccessible(GraalViewsRepository.Operator.Properties.description))
            operatorPart.setDescription(EcoreUtil.convertToString(EcorePackage.Literals.ESTRING, operator.getDescription()));
        if (isAccessible(GraalViewsRepository.Operator.Properties.outgoingTransitions)) {
            outgoingTransitionsSettings = new ReferencesTableSettings(operator, GraalPackage.eINSTANCE.getNode_OutgoingTransitions());
            operatorPart.initOutgoingTransitions(outgoingTransitionsSettings);
        }
        if (isAccessible(GraalViewsRepository.Operator.Properties.incomingTransitions)) {
            incomingTransitionsSettings = new ReferencesTableSettings(operator, GraalPackage.eINSTANCE.getNode_IncomingTransitions());
            operatorPart.initIncomingTransitions(incomingTransitionsSettings);
        }
        if (isAccessible(GraalViewsRepository.Operator.Properties.kind)) {
            operatorPart.initKind(EEFUtils.choiceOfValues(operator, GraalPackage.eINSTANCE.getOperator_Kind()), operator.getKind());
        }
        if (isAccessible(GraalViewsRepository.Operator.Properties.outgoingTransitions)) {
            operatorPart.addFilterToOutgoingTransitions(new EObjectFilter(GraalPackage.Literals.TRANSITION));
        // Start of user code for additional businessfilters for outgoingTransitions
        // End of user code
        }
        if (isAccessible(GraalViewsRepository.Operator.Properties.incomingTransitions)) {
            operatorPart.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 : Operator(org.obeonetwork.graal.Operator) EObjectFilter(org.eclipse.emf.eef.runtime.impl.filters.EObjectFilter) ReferencesTableSettings(org.eclipse.emf.eef.runtime.ui.widgets.referencestable.ReferencesTableSettings) OperatorPropertiesEditionPart(org.obeonetwork.graal.parts.OperatorPropertiesEditionPart)

Aggregations

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