Search in sources :

Example 6 with EObjectFlatComboSettings

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

the class InternalCriterionInternalCriterionPropertiesEditionComponent 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 InternalCriterion internalCriterion = (InternalCriterion) elt;
        final InternalCriterionPropertiesEditionPart internalCriterionPart = (InternalCriterionPropertiesEditionPart) editingPart;
        // init values
        if (isAccessible(EntityViewsRepository.InternalCriterion.Properties.target)) {
            // init part
            targetSettings = new EObjectFlatComboSettings(internalCriterion, EntityPackage.eINSTANCE.getInternalCriterion_Target());
            internalCriterionPart.initTarget(targetSettings);
            // set the button mode
            internalCriterionPart.setTargetButtonMode(ButtonsModeEnum.BROWSE);
        }
        if (isAccessible(EntityViewsRepository.InternalCriterion.Properties.description))
            internalCriterionPart.setDescription(EcoreUtil.convertToString(EcorePackage.Literals.ESTRING, internalCriterion.getDescription()));
    // init filters
    // init values for referenced views
    // init filters for referenced views
    }
    setInitializing(false);
}
Also used : InternalCriterionPropertiesEditionPart(org.obeonetwork.dsl.entity.parts.InternalCriterionPropertiesEditionPart) InternalCriterion(org.obeonetwork.dsl.entity.InternalCriterion) EObjectFlatComboSettings(org.eclipse.emf.eef.runtime.ui.widgets.eobjflatcombo.EObjectFlatComboSettings)

Example 7 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(FlowViewsRepository.Transition.Properties.description))
            transitionPart.setDescription(EcoreUtil.convertToString(EcorePackage.Literals.ESTRING, transition.getDescription()));
        if (isAccessible(FlowViewsRepository.Transition.Properties.name))
            transitionPart.setName(EEFConverterUtil.convertToString(EcorePackage.Literals.ESTRING, transition.getName()));
        if (isAccessible(FlowViewsRepository.Transition.Properties.guard))
            transitionPart.setGuard(EEFConverterUtil.convertToString(EcorePackage.Literals.ESTRING, transition.getGuard()));
        if (isAccessible(FlowViewsRepository.Transition.Properties.modal)) {
            transitionPart.setModal(transition.isModal());
        }
        if (isAccessible(FlowViewsRepository.Transition.Properties.from)) {
            // init part
            fromSettings = new EObjectFlatComboSettings(transition, FlowPackage.eINSTANCE.getTransition_From());
            transitionPart.initFrom(fromSettings);
            // set the button mode
            transitionPart.setFromButtonMode(ButtonsModeEnum.BROWSE);
        }
        if (isAccessible(FlowViewsRepository.Transition.Properties.to)) {
            // init part
            toSettings = new EObjectFlatComboSettings(transition, FlowPackage.eINSTANCE.getTransition_To());
            transitionPart.initTo(toSettings);
            // set the button mode
            transitionPart.setToButtonMode(ButtonsModeEnum.BROWSE);
        }
        if (isAccessible(FlowViewsRepository.Transition.Properties.on)) {
            onSettings = new ReferencesTableSettings(transition, FlowPackage.eINSTANCE.getTransition_On());
            transitionPart.initOn(onSettings);
        }
        if (isAccessible(FlowViewsRepository.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) {
                    // $NON-NLS-1$
                    return (element instanceof String && element.equals("")) || (element instanceof FlowState);
                }
            });
        // Start of user code for additional businessfilters for from
        // End of user code
        }
        if (isAccessible(FlowViewsRepository.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) {
                    // $NON-NLS-1$
                    return (element instanceof String && element.equals("")) || (element instanceof FlowState);
                }
            });
        // Start of user code for additional businessfilters for to
        // End of user code
        }
        if (isAccessible(FlowViewsRepository.Transition.Properties.on)) {
            transitionPart.addFilterToOn(new EObjectFilter(CinematicPackage.Literals.EVENT));
        // Start of user code for additional businessfilters for on
        // 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) FlowState(org.obeonetwork.dsl.cinematic.flow.FlowState) ReferencesTableSettings(org.eclipse.emf.eef.runtime.ui.widgets.referencestable.ReferencesTableSettings) ViewerFilter(org.eclipse.jface.viewers.ViewerFilter) Transition(org.obeonetwork.dsl.cinematic.flow.Transition) TransitionPropertiesEditionPart(org.obeonetwork.dsl.cinematic.flow.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 8 with EObjectFlatComboSettings

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

the class ViewElementViewElementPropertiesEditionComponent 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 ViewElement viewElement = (ViewElement) elt;
        final ViewElementPropertiesEditionPart viewElementPart = (ViewElementPropertiesEditionPart) editingPart;
        // init values
        if (isAccessible(ViewViewsRepository.ViewElement.Properties.description))
            viewElementPart.setDescription(EcoreUtil.convertToString(EcorePackage.Literals.ESTRING, viewElement.getDescription()));
        if (isAccessible(ViewViewsRepository.ViewElement.Properties.name))
            viewElementPart.setName(EEFConverterUtil.convertToString(EcorePackage.Literals.ESTRING, viewElement.getName()));
        if (isAccessible(ViewViewsRepository.ViewElement.Properties.widget)) {
            // init part
            widgetSettings = new EObjectFlatComboSettings(viewElement, ViewPackage.eINSTANCE.getAbstractViewElement_Widget());
            viewElementPart.initWidget(widgetSettings);
            // set the button mode
            viewElementPart.setWidgetButtonMode(ButtonsModeEnum.BROWSE);
        }
        if (isAccessible(ViewViewsRepository.ViewElement.Properties.actions)) {
            actionsSettings = new ReferencesTableSettings(viewElement, ViewPackage.eINSTANCE.getAbstractViewElement_Actions());
            viewElementPart.initActions(actionsSettings);
        }
        if (isAccessible(ViewViewsRepository.ViewElement.Properties.events)) {
            eventsSettings = new ReferencesTableSettings(viewElement, ViewPackage.eINSTANCE.getAbstractViewElement_Events());
            viewElementPart.initEvents(eventsSettings);
        }
        if (isAccessible(ViewViewsRepository.ViewElement.Properties.label))
            viewElementPart.setLabel(EEFConverterUtil.convertToString(EcorePackage.Literals.ESTRING, viewElement.getLabel()));
        if (isAccessible(ViewViewsRepository.ViewElement.Properties.required)) {
            viewElementPart.setRequired(viewElement.isRequired());
        }
        if (isAccessible(ViewViewsRepository.ViewElement.Properties.type)) {
            // init part
            typeSettings = new EObjectFlatComboSettings(viewElement, ViewPackage.eINSTANCE.getViewElement_Type());
            viewElementPart.initType(typeSettings);
            // set the button mode
            viewElementPart.setTypeButtonMode(ButtonsModeEnum.BROWSE);
        }
        if (isAccessible(ViewViewsRepository.ViewElement.Properties.widget)) {
            viewElementPart.addFilterToWidget(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 Widget);
                }
            });
        // Start of user code for additional businessfilters for widget
        // End of user code
        }
        if (isAccessible(ViewViewsRepository.ViewElement.Properties.actions)) {
            viewElementPart.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 ViewAction);
                }
            });
        // Start of user code for additional businessfilters for actions
        // End of user code
        }
        if (isAccessible(ViewViewsRepository.ViewElement.Properties.events)) {
            viewElementPart.addFilterToEvents(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 ViewEvent);
                }
            });
        // Start of user code for additional businessfilters for events
        // End of user code
        }
        if (isAccessible(ViewViewsRepository.ViewElement.Properties.type)) {
            viewElementPart.addFilterToType(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 Type);
                }
            });
        // Start of user code for additional businessfilters for type
        // End of user code
        }
    // init values for referenced views
    // init filters for referenced views
    }
    setInitializing(false);
}
Also used : Type(org.obeonetwork.dsl.environment.Type) ReferencesTableSettings(org.eclipse.emf.eef.runtime.ui.widgets.referencestable.ReferencesTableSettings) ViewerFilter(org.eclipse.jface.viewers.ViewerFilter) ViewAction(org.obeonetwork.dsl.cinematic.view.ViewAction) ViewEvent(org.obeonetwork.dsl.cinematic.view.ViewEvent) Widget(org.obeonetwork.dsl.cinematic.toolkits.Widget) Viewer(org.eclipse.jface.viewers.Viewer) EObject(org.eclipse.emf.ecore.EObject) EObjectFlatComboSettings(org.eclipse.emf.eef.runtime.ui.widgets.eobjflatcombo.EObjectFlatComboSettings) ViewElement(org.obeonetwork.dsl.cinematic.view.ViewElement) ViewElementPropertiesEditionPart(org.obeonetwork.dsl.cinematic.view.parts.ViewElementPropertiesEditionPart)

Example 9 with EObjectFlatComboSettings

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

the class ParticipantParticipantPropertiesEditionComponent 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 Participant participant = (Participant) elt;
        final ParticipantPropertiesEditionPart participantPart = (ParticipantPropertiesEditionPart) editingPart;
        // init values
        if (isAccessible(InteractionViewsRepository.Participant.Properties.name))
            participantPart.setName(EEFConverterUtil.convertToString(EcorePackage.Literals.ESTRING, participant.getName()));
        if (isAccessible(InteractionViewsRepository.Participant.Properties.type)) {
            // init part
            typeSettings = new EObjectFlatComboSettings(participant, InteractionPackage.eINSTANCE.getParticipant_Type());
            participantPart.initType(typeSettings);
            // set the button mode
            participantPart.setTypeButtonMode(ButtonsModeEnum.BROWSE);
        }
        if (isAccessible(InteractionViewsRepository.Participant.Properties.description))
            participantPart.setDescription(EEFConverterUtil.convertToString(EcorePackage.Literals.ESTRING, participant.getDescription()));
        if (isAccessible(InteractionViewsRepository.Participant.Properties.type)) {
            participantPart.addFilterToType(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 ObeoDSMObject);
                }
            });
        // Start of user code for additional businessfilters for type
        // End of user code
        }
    // init values for referenced views
    // init filters for referenced views
    }
    setInitializing(false);
}
Also used : Participant(org.obeonetwork.dsl.interaction.Participant) ViewerFilter(org.eclipse.jface.viewers.ViewerFilter) ObeoDSMObject(org.obeonetwork.dsl.environment.ObeoDSMObject) ParticipantPropertiesEditionPart(org.obeonetwork.dsl.interaction.parts.ParticipantPropertiesEditionPart) Viewer(org.eclipse.jface.viewers.Viewer) EObject(org.eclipse.emf.ecore.EObject) ObeoDSMObject(org.obeonetwork.dsl.environment.ObeoDSMObject) EObjectFlatComboSettings(org.eclipse.emf.eef.runtime.ui.widgets.eobjflatcombo.EObjectFlatComboSettings)

Example 10 with EObjectFlatComboSettings

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

the class DtoDtoPropertiesEditionComponent 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 DTO dTO = (DTO) elt;
        final DtoPropertiesEditionPart dtoPart = (DtoPropertiesEditionPart) editingPart;
        // init values
        if (isAccessible(EnvironmentViewsRepository.Dto.Properties.name))
            dtoPart.setName(EEFConverterUtil.convertToString(EcorePackage.Literals.ESTRING, dTO.getName()));
        if (isAccessible(EnvironmentViewsRepository.Dto.Properties.supertype)) {
            // init part
            supertypeSettings = new EObjectFlatComboSettings(dTO, EnvironmentPackage.eINSTANCE.getStructuredType_Supertype());
            dtoPart.initSupertype(supertypeSettings);
            // set the button mode
            dtoPart.setSupertypeButtonMode(ButtonsModeEnum.BROWSE);
        }
        if (isAccessible(EnvironmentViewsRepository.Dto.Properties.description))
            dtoPart.setDescription(EcoreUtil.convertToString(EcorePackage.Literals.ESTRING, dTO.getDescription()));
        if (isAccessible(EnvironmentViewsRepository.Dto.Properties.associatedTypes)) {
            associatedTypesSettings = new ReferencesTableSettings(dTO, EnvironmentPackage.eINSTANCE.getStructuredType_AssociatedTypes());
            dtoPart.initAssociatedTypes(associatedTypesSettings);
        }
        if (isAccessible(EnvironmentViewsRepository.Dto.Properties.supertype)) {
            dtoPart.addFilterToSupertype(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 StructuredType);
                }
            });
        // Start of user code for additional businessfilters for supertype
        // End of user code
        }
        if (isAccessible(EnvironmentViewsRepository.Dto.Properties.associatedTypes)) {
            dtoPart.addFilterToAssociatedTypes(new EObjectFilter(EnvironmentPackage.Literals.STRUCTURED_TYPE));
        // Start of user code for additional businessfilters for associatedTypes
        // 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) DtoPropertiesEditionPart(org.obeonetwork.dsl.environment.parts.DtoPropertiesEditionPart) Viewer(org.eclipse.jface.viewers.Viewer) EObject(org.eclipse.emf.ecore.EObject) EObjectFlatComboSettings(org.eclipse.emf.eef.runtime.ui.widgets.eobjflatcombo.EObjectFlatComboSettings) DTO(org.obeonetwork.dsl.environment.DTO) StructuredType(org.obeonetwork.dsl.environment.StructuredType)

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