Search in sources :

Example 1 with FlowActionPropertiesEditionPart

use of org.obeonetwork.dsl.cinematic.flow.parts.FlowActionPropertiesEditionPart in project InformationSystem by ObeoNetwork.

the class FlowActionFlowActionPropertiesEditionComponent 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 FlowAction flowAction = (FlowAction) elt;
        final FlowActionPropertiesEditionPart flowActionPart = (FlowActionPropertiesEditionPart) editingPart;
        // init values
        if (isAccessible(FlowViewsRepository.FlowAction.Properties.description))
            flowActionPart.setDescription(EcoreUtil.convertToString(EcorePackage.Literals.ESTRING, flowAction.getDescription()));
        if (isAccessible(FlowViewsRepository.FlowAction.Properties.name))
            flowActionPart.setName(EEFConverterUtil.convertToString(EcorePackage.Literals.ESTRING, flowAction.getName()));
        if (isAccessible(FlowViewsRepository.FlowAction.Properties.calls)) {
            callsSettings = new ReferencesTableSettings(flowAction, FlowPackage.eINSTANCE.getFlowAction_Calls());
            flowActionPart.initCalls(callsSettings);
        }
        if (isAccessible(FlowViewsRepository.FlowAction.Properties.operations)) {
            operationsSettings = new ReferencesTableSettings(flowAction, FlowPackage.eINSTANCE.getFlowAction_Operations());
            flowActionPart.initOperations(operationsSettings);
        }
        if (isAccessible(FlowViewsRepository.FlowAction.Properties.calls)) {
            flowActionPart.addFilterToCalls(new EObjectFilter(ViewPackage.Literals.VIEW_ACTION));
        // Start of user code for additional businessfilters for calls
        // End of user code
        }
        if (isAccessible(FlowViewsRepository.FlowAction.Properties.operations)) {
            flowActionPart.addFilterToOperations(new EObjectFilter(EnvironmentPackage.Literals.ACTION));
        // Start of user code for additional businessfilters for operations
        // End of user code
        }
    // init values for referenced views
    // init filters for referenced views
    }
    setInitializing(false);
}
Also used : EObjectFilter(org.eclipse.emf.eef.runtime.impl.filters.EObjectFilter) ReferencesTableSettings(org.eclipse.emf.eef.runtime.ui.widgets.referencestable.ReferencesTableSettings) FlowAction(org.obeonetwork.dsl.cinematic.flow.FlowAction) FlowActionPropertiesEditionPart(org.obeonetwork.dsl.cinematic.flow.parts.FlowActionPropertiesEditionPart)

Aggregations

EObjectFilter (org.eclipse.emf.eef.runtime.impl.filters.EObjectFilter)1 ReferencesTableSettings (org.eclipse.emf.eef.runtime.ui.widgets.referencestable.ReferencesTableSettings)1 FlowAction (org.obeonetwork.dsl.cinematic.flow.FlowAction)1 FlowActionPropertiesEditionPart (org.obeonetwork.dsl.cinematic.flow.parts.FlowActionPropertiesEditionPart)1