Search in sources :

Example 46 with ReferencesTableSettings

use of org.eclipse.emf.eef.runtime.ui.widgets.referencestable.ReferencesTableSettings 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 47 with ReferencesTableSettings

use of org.eclipse.emf.eef.runtime.ui.widgets.referencestable.ReferencesTableSettings 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)

Example 48 with ReferencesTableSettings

use of org.eclipse.emf.eef.runtime.ui.widgets.referencestable.ReferencesTableSettings in project InformationSystem by ObeoNetwork.

the class InitialStateInitialStatePropertiesEditionComponent 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 InitialState initialState = (InitialState) elt;
        final InitialStatePropertiesEditionPart initialStatePart = (InitialStatePropertiesEditionPart) editingPart;
        // init values
        if (isAccessible(StatemachineViewsRepository.InitialState.Properties.description))
            initialStatePart.setDescription(EEFConverterUtil.convertToString(EcorePackage.Literals.ESTRING, initialState.getDescription()));
        if (isAccessible(StatemachineViewsRepository.InitialState.Properties.keywords))
            initialStatePart.setKeywords(initialState.getKeywords());
        if (isAccessible(StatemachineViewsRepository.InitialState.Properties.incomingTransitions)) {
            incomingTransitionsSettings = new ReferencesTableSettings(initialState, StateMachinePackage.eINSTANCE.getAbstractState_IncomingTransitions());
            initialStatePart.initIncomingTransitions(incomingTransitionsSettings);
        }
        if (isAccessible(StatemachineViewsRepository.InitialState.Properties.outcomingTransitions)) {
            outcomingTransitionsSettings = new ReferencesTableSettings(initialState, StateMachinePackage.eINSTANCE.getAbstractState_OutcomingTransitions());
            initialStatePart.initOutcomingTransitions(outcomingTransitionsSettings);
        }
        if (isAccessible(StatemachineViewsRepository.InitialState.Properties.incomingTransitions)) {
            initialStatePart.addFilterToIncomingTransitions(new EObjectFilter(StateMachinePackage.Literals.TRANSITION));
        // Start of user code for additional businessfilters for incomingTransitions
        // End of user code
        }
        if (isAccessible(StatemachineViewsRepository.InitialState.Properties.outcomingTransitions)) {
            initialStatePart.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);
}
Also used : EObjectFilter(org.eclipse.emf.eef.runtime.impl.filters.EObjectFilter) ReferencesTableSettings(org.eclipse.emf.eef.runtime.ui.widgets.referencestable.ReferencesTableSettings) InitialState(org.obeonetwork.dsl.statemachine.InitialState) InitialStatePropertiesEditionPart(org.obeonetwork.dsl.statemachine.parts.InitialStatePropertiesEditionPart)

Example 49 with ReferencesTableSettings

use of org.eclipse.emf.eef.runtime.ui.widgets.referencestable.ReferencesTableSettings in project InformationSystem by ObeoNetwork.

the class StateMachineStateMachinePropertiesEditionComponent 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 StateMachine stateMachine = (StateMachine) elt;
        final StateMachinePropertiesEditionPart stateMachinePart = (StateMachinePropertiesEditionPart) editingPart;
        // init values
        if (isAccessible(StatemachineViewsRepository.StateMachine_.Properties.description))
            stateMachinePart.setDescription(EEFConverterUtil.convertToString(EcorePackage.Literals.ESTRING, stateMachine.getDescription()));
        if (isAccessible(StatemachineViewsRepository.StateMachine_.Properties.keywords))
            stateMachinePart.setKeywords(stateMachine.getKeywords());
        if (isAccessible(StatemachineViewsRepository.StateMachine_.Properties.name))
            stateMachinePart.setName(EEFConverterUtil.convertToString(EcorePackage.Literals.ESTRING, stateMachine.getName()));
        if (isAccessible(StatemachineViewsRepository.StateMachine_.Properties.regions)) {
            regionsSettings = new ReferencesTableSettings(stateMachine, StateMachinePackage.eINSTANCE.getStateMachine_Regions());
            stateMachinePart.initRegions(regionsSettings);
        }
        if (isAccessible(StatemachineViewsRepository.StateMachine_.Properties.regions)) {
            stateMachinePart.addFilterToRegions(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 Region);
                }
            });
        // Start of user code for additional businessfilters for regions
        // 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) StateMachine(org.obeonetwork.dsl.statemachine.StateMachine) Region(org.obeonetwork.dsl.statemachine.Region) Viewer(org.eclipse.jface.viewers.Viewer) EObject(org.eclipse.emf.ecore.EObject) StateMachinePropertiesEditionPart(org.obeonetwork.dsl.statemachine.parts.StateMachinePropertiesEditionPart)

Example 50 with ReferencesTableSettings

use of org.eclipse.emf.eef.runtime.ui.widgets.referencestable.ReferencesTableSettings in project InformationSystem by ObeoNetwork.

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

Aggregations

ReferencesTableSettings (org.eclipse.emf.eef.runtime.ui.widgets.referencestable.ReferencesTableSettings)56 EObject (org.eclipse.emf.ecore.EObject)38 Viewer (org.eclipse.jface.viewers.Viewer)38 ViewerFilter (org.eclipse.jface.viewers.ViewerFilter)38 EObjectFilter (org.eclipse.emf.eef.runtime.impl.filters.EObjectFilter)23 EObjectFlatComboSettings (org.eclipse.emf.eef.runtime.ui.widgets.eobjflatcombo.EObjectFlatComboSettings)11 FlowAction (org.obeonetwork.dsl.cinematic.flow.FlowAction)9 Table (org.obeonetwork.dsl.database.Table)6 EObjectStrictFilter (org.eclipse.emf.eef.runtime.impl.filters.EObjectStrictFilter)5 Flow (org.obeonetwork.dsl.cinematic.flow.Flow)4 ViewContainer (org.obeonetwork.dsl.cinematic.view.ViewContainer)4 Widget (org.obeonetwork.dsl.cinematic.toolkits.Widget)3 ViewAction (org.obeonetwork.dsl.cinematic.view.ViewAction)3 ViewEvent (org.obeonetwork.dsl.cinematic.view.ViewEvent)3 EcorePackage (org.eclipse.emf.ecore.EcorePackage)2 CompositePropertiesEditionPart (org.eclipse.emf.eef.runtime.impl.parts.CompositePropertiesEditionPart)2 CinematicPackage (org.obeonetwork.dsl.cinematic.CinematicPackage)2 CinematicRoot (org.obeonetwork.dsl.cinematic.CinematicRoot)2 Package (org.obeonetwork.dsl.cinematic.Package)2 FlowEvent (org.obeonetwork.dsl.cinematic.flow.FlowEvent)2