Search in sources :

Example 21 with EObjectFlatComboSettings

use of org.eclipse.emf.eef.runtime.ui.widgets.eobjflatcombo.EObjectFlatComboSettings in project InformationSystem by ObeoNetwork.

the class SubflowStateSubflowStatePropertiesEditionComponent 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 SubflowState subflowState = (SubflowState) elt;
        final SubflowStatePropertiesEditionPart subflowStatePart = (SubflowStatePropertiesEditionPart) editingPart;
        // init values
        if (isAccessible(FlowViewsRepository.SubflowState.Properties.description))
            subflowStatePart.setDescription(EcoreUtil.convertToString(EcorePackage.Literals.ESTRING, subflowState.getDescription()));
        if (isAccessible(FlowViewsRepository.SubflowState.Properties.actions)) {
            actionsSettings = new ReferencesTableSettings(subflowState, FlowPackage.eINSTANCE.getFlowState_Actions());
            subflowStatePart.initActions(actionsSettings);
        }
        if (isAccessible(FlowViewsRepository.SubflowState.Properties.subflow)) {
            // init part
            subflowSettings = new EObjectFlatComboSettings(subflowState, FlowPackage.eINSTANCE.getSubflowState_Subflow());
            subflowStatePart.initSubflow(subflowSettings);
            // set the button mode
            subflowStatePart.setSubflowButtonMode(ButtonsModeEnum.BROWSE);
        }
        if (isAccessible(FlowViewsRepository.SubflowState.Properties.actions)) {
            subflowStatePart.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
        }
        if (isAccessible(FlowViewsRepository.SubflowState.Properties.subflow)) {
            subflowStatePart.addFilterToSubflow(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) {
                    return (element instanceof Flow);
                }
            });
        // Start of user code for additional businessfilters for subflow
        // 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) SubflowState(org.obeonetwork.dsl.cinematic.flow.SubflowState) SubflowStatePropertiesEditionPart(org.obeonetwork.dsl.cinematic.flow.parts.SubflowStatePropertiesEditionPart) Viewer(org.eclipse.jface.viewers.Viewer) EObject(org.eclipse.emf.ecore.EObject) EObjectFlatComboSettings(org.eclipse.emf.eef.runtime.ui.widgets.eobjflatcombo.EObjectFlatComboSettings) Flow(org.obeonetwork.dsl.cinematic.flow.Flow)

Example 22 with EObjectFlatComboSettings

use of org.eclipse.emf.eef.runtime.ui.widgets.eobjflatcombo.EObjectFlatComboSettings in project InformationSystem by ObeoNetwork.

the class TransitionTransitionPropertiesEditionComponent 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 Transition transition = (Transition) elt;
        final TransitionPropertiesEditionPart transitionPart = (TransitionPropertiesEditionPart) editingPart;
        // init values
        if (isAccessible(StatemachineViewsRepository.Transition.Properties.description))
            transitionPart.setDescription(EEFConverterUtil.convertToString(EcorePackage.Literals.ESTRING, transition.getDescription()));
        if (isAccessible(StatemachineViewsRepository.Transition.Properties.keywords))
            transitionPart.setKeywords(transition.getKeywords());
        if (isAccessible(StatemachineViewsRepository.Transition.Properties.guard))
            transitionPart.setGuard(EEFConverterUtil.convertToString(EcorePackage.Literals.ESTRING, transition.getGuard()));
        if (isAccessible(StatemachineViewsRepository.Transition.Properties.from)) {
            // init part
            fromSettings = new EObjectFlatComboSettings(transition, StateMachinePackage.eINSTANCE.getTransition_From());
            transitionPart.initFrom(fromSettings);
            // set the button mode
            transitionPart.setFromButtonMode(ButtonsModeEnum.BROWSE);
        }
        if (isAccessible(StatemachineViewsRepository.Transition.Properties.to)) {
            // init part
            toSettings = new EObjectFlatComboSettings(transition, StateMachinePackage.eINSTANCE.getTransition_To());
            transitionPart.initTo(toSettings);
            // set the button mode
            transitionPart.setToButtonMode(ButtonsModeEnum.BROWSE);
        }
        if (isAccessible(StatemachineViewsRepository.Transition.Properties.from)) {
            transitionPart.addFilterToFrom(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) {
                    return (element instanceof AbstractState);
                }
            });
        // Start of user code for additional businessfilters for from
        // End of user code
        }
        if (isAccessible(StatemachineViewsRepository.Transition.Properties.to)) {
            transitionPart.addFilterToTo(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) {
                    return (element instanceof AbstractState);
                }
            });
        // Start of user code for additional businessfilters for to
        // End of user code
        }
    // init values for referenced views
    // init filters for referenced views
    }
    setInitializing(false);
}
Also used : ViewerFilter(org.eclipse.jface.viewers.ViewerFilter) Transition(org.obeonetwork.dsl.statemachine.Transition) AbstractState(org.obeonetwork.dsl.statemachine.AbstractState) TransitionPropertiesEditionPart(org.obeonetwork.dsl.statemachine.parts.TransitionPropertiesEditionPart) Viewer(org.eclipse.jface.viewers.Viewer) EObject(org.eclipse.emf.ecore.EObject) EObjectFlatComboSettings(org.eclipse.emf.eef.runtime.ui.widgets.eobjflatcombo.EObjectFlatComboSettings)

Example 23 with EObjectFlatComboSettings

use of org.eclipse.emf.eef.runtime.ui.widgets.eobjflatcombo.EObjectFlatComboSettings in project InformationSystem by ObeoNetwork.

the class ParameterParameterPropertiesEditionComponent 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 Parameter parameter = (Parameter) elt;
        final ParameterPropertiesEditionPart parameterPart = (ParameterPropertiesEditionPart) editingPart;
        // init values
        if (isAccessible(SoaViewsRepository.Parameter.Properties.name))
            parameterPart.setName(EEFConverterUtil.convertToString(EcorePackage.Literals.ESTRING, parameter.getName()));
        if (isAccessible(SoaViewsRepository.Parameter.Properties.multiplicity)) {
            parameterPart.initMultiplicity(EEFUtils.choiceOfValues(parameter, SoaPackage.eINSTANCE.getParameter_Multiplicity()), parameter.getMultiplicity());
        }
        if (isAccessible(SoaViewsRepository.Parameter.Properties.isUnique)) {
            parameterPart.setIsUnique(parameter.isIsUnique());
        }
        if (isAccessible(SoaViewsRepository.Parameter.Properties.isOrdered)) {
            parameterPart.setIsOrdered(parameter.isIsOrdered());
        }
        if (isAccessible(SoaViewsRepository.Parameter.Properties.type)) {
            // init part
            typeSettings = new EObjectFlatComboSettings(parameter, SoaPackage.eINSTANCE.getParameter_Type());
            parameterPart.initType(typeSettings);
            // set the button mode
            parameterPart.setTypeButtonMode(ButtonsModeEnum.BROWSE);
        }
        if (isAccessible(SoaViewsRepository.Parameter.Properties.description))
            parameterPart.setDescription(EcoreUtil.convertToString(EcorePackage.Literals.ESTRING, parameter.getDescription()));
    // init filters
    // init values for referenced views
    // init filters for referenced views
    }
    setInitializing(false);
}
Also used : Parameter(org.obeonetwork.dsl.soa.Parameter) EObjectFlatComboSettings(org.eclipse.emf.eef.runtime.ui.widgets.eobjflatcombo.EObjectFlatComboSettings) ParameterPropertiesEditionPart(org.obeonetwork.dsl.soa.parts.ParameterPropertiesEditionPart)

Example 24 with EObjectFlatComboSettings

use of org.eclipse.emf.eef.runtime.ui.widgets.eobjflatcombo.EObjectFlatComboSettings in project InformationSystem by ObeoNetwork.

the class WireWirePropertiesEditionComponent 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 Wire wire = (Wire) elt;
        final WirePropertiesEditionPart wirePart = (WirePropertiesEditionPart) editingPart;
        // init values
        if (isAccessible(SoaViewsRepository.Wire.Properties.source)) {
            // init part
            sourceSettings = new EObjectFlatComboSettings(wire, SoaPackage.eINSTANCE.getWire_Source());
            wirePart.initSource(sourceSettings);
            // set the button mode
            wirePart.setSourceButtonMode(ButtonsModeEnum.BROWSE);
        }
        if (isAccessible(SoaViewsRepository.Wire.Properties.dest)) {
            // init part
            destSettings = new EObjectFlatComboSettings(wire, SoaPackage.eINSTANCE.getWire_Dest());
            wirePart.initDest(destSettings);
            // set the button mode
            wirePart.setDestButtonMode(ButtonsModeEnum.BROWSE);
        }
        if (isAccessible(SoaViewsRepository.Wire.Properties.description))
            wirePart.setDescription(EcoreUtil.convertToString(EcorePackage.Literals.ESTRING, wire.getDescription()));
    // init filters
    // init values for referenced views
    // init filters for referenced views
    }
    setInitializing(false);
}
Also used : WirePropertiesEditionPart(org.obeonetwork.dsl.soa.parts.WirePropertiesEditionPart) EObjectFlatComboSettings(org.eclipse.emf.eef.runtime.ui.widgets.eobjflatcombo.EObjectFlatComboSettings) Wire(org.obeonetwork.dsl.soa.Wire)

Example 25 with EObjectFlatComboSettings

use of org.eclipse.emf.eef.runtime.ui.widgets.eobjflatcombo.EObjectFlatComboSettings in project InformationSystem by ObeoNetwork.

the class ActorActorPropertiesEditionComponent 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 Actor actor = (Actor) elt;
        final ActorPropertiesEditionPart actorPart = (ActorPropertiesEditionPart) editingPart;
        // init values
        if (isAccessible(GraalViewsRepository.Actor.Properties.description))
            actorPart.setDescription(EcoreUtil.convertToString(EcorePackage.Literals.ESTRING, actor.getDescription()));
        if (isAccessible(GraalViewsRepository.Actor.Properties.subActors)) {
            subActorsSettings = new ReferencesTableSettings(actor, GraalPackage.eINSTANCE.getActor_SubActors());
            actorPart.initSubActors(subActorsSettings);
        }
        if (isAccessible(GraalViewsRepository.Actor.Properties.superActor)) {
            // init part
            superActorSettings = new EObjectFlatComboSettings(actor, GraalPackage.eINSTANCE.getActor_SuperActor());
            actorPart.initSuperActor(superActorSettings);
            // set the button mode
            actorPart.setSuperActorButtonMode(ButtonsModeEnum.BROWSE);
        }
        if (isAccessible(GraalViewsRepository.Actor.Properties.name))
            actorPart.setName(EEFConverterUtil.convertToString(EcorePackage.Literals.ESTRING, actor.getName()));
        if (isAccessible(GraalViewsRepository.Actor.Properties.subActors)) {
            actorPart.addFilterToSubActors(new EObjectFilter(GraalPackage.Literals.ACTOR));
        // Start of user code for additional businessfilters for subActors
        // End of user code
        }
        if (isAccessible(GraalViewsRepository.Actor.Properties.superActor)) {
            actorPart.addFilterToSuperActor(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 Actor);
                }
            });
        // Start of user code for additional businessfilters for superActor
        // 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) ViewerFilter(org.eclipse.jface.viewers.ViewerFilter) Actor(org.obeonetwork.graal.Actor) Viewer(org.eclipse.jface.viewers.Viewer) EObject(org.eclipse.emf.ecore.EObject) EObjectFlatComboSettings(org.eclipse.emf.eef.runtime.ui.widgets.eobjflatcombo.EObjectFlatComboSettings) ActorPropertiesEditionPart(org.obeonetwork.graal.parts.ActorPropertiesEditionPart)

Aggregations

EObjectFlatComboSettings (org.eclipse.emf.eef.runtime.ui.widgets.eobjflatcombo.EObjectFlatComboSettings)28 EObject (org.eclipse.emf.ecore.EObject)22 Viewer (org.eclipse.jface.viewers.Viewer)22 ViewerFilter (org.eclipse.jface.viewers.ViewerFilter)22 ReferencesTableSettings (org.eclipse.emf.eef.runtime.ui.widgets.referencestable.ReferencesTableSettings)11 EObjectFilter (org.eclipse.emf.eef.runtime.impl.filters.EObjectFilter)6 ViewEvent (org.obeonetwork.dsl.cinematic.view.ViewEvent)4 Widget (org.obeonetwork.dsl.cinematic.toolkits.Widget)3 ViewAction (org.obeonetwork.dsl.cinematic.view.ViewAction)3 Column (org.obeonetwork.dsl.database.Column)3 ViewContainer (org.obeonetwork.dsl.cinematic.view.ViewContainer)2 ForeignKey (org.obeonetwork.dsl.database.ForeignKey)2 ForeignKeyElement (org.obeonetwork.dsl.database.ForeignKeyElement)2 Table (org.obeonetwork.dsl.database.Table)2 StructuredType (org.obeonetwork.dsl.environment.StructuredType)2 CompositePropertiesEditionPart (org.eclipse.emf.eef.runtime.impl.parts.CompositePropertiesEditionPart)1 Flow (org.obeonetwork.dsl.cinematic.flow.Flow)1 FlowAction (org.obeonetwork.dsl.cinematic.flow.FlowAction)1 FlowState (org.obeonetwork.dsl.cinematic.flow.FlowState)1 SubflowState (org.obeonetwork.dsl.cinematic.flow.SubflowState)1