Search in sources :

Example 16 with FlowAction

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

the class DecisionStateDecisionStatePropertiesEditionComponent 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 DecisionState decisionState = (DecisionState) elt;
        final DecisionStatePropertiesEditionPart decisionStatePart = (DecisionStatePropertiesEditionPart) editingPart;
        // init values
        if (isAccessible(FlowViewsRepository.DecisionState.Properties.description))
            decisionStatePart.setDescription(EcoreUtil.convertToString(EcorePackage.Literals.ESTRING, decisionState.getDescription()));
        if (isAccessible(FlowViewsRepository.DecisionState.Properties.actions)) {
            actionsSettings = new ReferencesTableSettings(decisionState, FlowPackage.eINSTANCE.getFlowState_Actions());
            decisionStatePart.initActions(actionsSettings);
        }
        if (isAccessible(FlowViewsRepository.DecisionState.Properties.name))
            decisionStatePart.setName(EEFConverterUtil.convertToString(EcorePackage.Literals.ESTRING, decisionState.getName()));
        if (isAccessible(FlowViewsRepository.DecisionState.Properties.actions)) {
            decisionStatePart.addFilterToActions(new ViewerFilter() {

                /**
                 * {@inheritDoc}
                 *
                 * @see org.eclipse.jface.viewers.ViewerFilter#select(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
                 */
                public boolean select(Viewer viewer, Object parentElement, Object element) {
                    // $NON-NLS-1$
                    return (element instanceof String && element.equals("")) || (element instanceof FlowAction);
                }
            });
        // Start of user code for additional businessfilters for actions
        // End of user code
        }
    // init values for referenced views
    // init filters for referenced views
    }
    setInitializing(false);
}
Also used : ReferencesTableSettings(org.eclipse.emf.eef.runtime.ui.widgets.referencestable.ReferencesTableSettings) ViewerFilter(org.eclipse.jface.viewers.ViewerFilter) FlowAction(org.obeonetwork.dsl.cinematic.flow.FlowAction) DecisionStatePropertiesEditionPart(org.obeonetwork.dsl.cinematic.flow.parts.DecisionStatePropertiesEditionPart) Viewer(org.eclipse.jface.viewers.Viewer) EObject(org.eclipse.emf.ecore.EObject) DecisionState(org.obeonetwork.dsl.cinematic.flow.DecisionState)

Example 17 with FlowAction

use of org.obeonetwork.dsl.cinematic.flow.FlowAction 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

FlowAction (org.obeonetwork.dsl.cinematic.flow.FlowAction)17 EObject (org.eclipse.emf.ecore.EObject)16 ReferencesTableSettings (org.eclipse.emf.eef.runtime.ui.widgets.referencestable.ReferencesTableSettings)9 EObjectPropertiesEditionContext (org.eclipse.emf.eef.runtime.context.impl.EObjectPropertiesEditionContext)8 EReferencePropertiesEditionContext (org.eclipse.emf.eef.runtime.context.impl.EReferencePropertiesEditionContext)8 PropertiesEditingPolicy (org.eclipse.emf.eef.runtime.policies.PropertiesEditingPolicy)8 CreateEditingPolicy (org.eclipse.emf.eef.runtime.policies.impl.CreateEditingPolicy)8 PropertiesEditingProvider (org.eclipse.emf.eef.runtime.providers.PropertiesEditingProvider)8 Viewer (org.eclipse.jface.viewers.Viewer)8 ViewerFilter (org.eclipse.jface.viewers.ViewerFilter)8 EObjectFilter (org.eclipse.emf.eef.runtime.impl.filters.EObjectFilter)2 AbortState (org.obeonetwork.dsl.cinematic.flow.AbortState)2 ActionState (org.obeonetwork.dsl.cinematic.flow.ActionState)2 AsyncEventState (org.obeonetwork.dsl.cinematic.flow.AsyncEventState)2 DecisionState (org.obeonetwork.dsl.cinematic.flow.DecisionState)2 FinalState (org.obeonetwork.dsl.cinematic.flow.FinalState)2 Flow (org.obeonetwork.dsl.cinematic.flow.Flow)2 InitialState (org.obeonetwork.dsl.cinematic.flow.InitialState)2 SubflowState (org.obeonetwork.dsl.cinematic.flow.SubflowState)2 ViewState (org.obeonetwork.dsl.cinematic.flow.ViewState)2