Search in sources :

Example 26 with EObjectFlatComboSettings

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

the class InterDSMLinkInterDSMLinkPropertiesEditionComponent 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 InterDSMLink interDSMLink = (InterDSMLink) elt;
        final InterDSMLinkPropertiesEditionPart interDSMLinkPart = (InterDSMLinkPropertiesEditionPart) editingPart;
        // init values
        if (isAccessible(EnvironmentViewsRepository.InterDSMLink.Properties.name))
            interDSMLinkPart.setName(EEFConverterUtil.convertToString(EcorePackage.Literals.ESTRING, interDSMLink.getName()));
        if (isAccessible(EnvironmentViewsRepository.InterDSMLink.Properties.target)) {
            // init part
            targetSettings = new EObjectFlatComboSettings(interDSMLink, EnvironmentPackage.eINSTANCE.getInterDSMLink_Target());
            interDSMLinkPart.initTarget(targetSettings);
            // set the button mode
            interDSMLinkPart.setTargetButtonMode(ButtonsModeEnum.BROWSE);
        }
        if (isAccessible(EnvironmentViewsRepository.InterDSMLink.Properties.description))
            interDSMLinkPart.setDescription(EcoreUtil.convertToString(EcorePackage.Literals.ESTRING, interDSMLink.getDescription()));
        if (isAccessible(EnvironmentViewsRepository.InterDSMLink.Properties.target)) {
            interDSMLinkPart.addFilterToTarget(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 EObject);
                }
            });
        // Start of user code for additional businessfilters for target
        // End of user code
        }
    // init values for referenced views
    // init filters for referenced views
    }
    setInitializing(false);
}
Also used : InterDSMLinkPropertiesEditionPart(org.obeonetwork.dsl.environment.parts.InterDSMLinkPropertiesEditionPart) ViewerFilter(org.eclipse.jface.viewers.ViewerFilter) EObject(org.eclipse.emf.ecore.EObject) InterDSMLink(org.obeonetwork.dsl.environment.InterDSMLink) Viewer(org.eclipse.jface.viewers.Viewer) EObject(org.eclipse.emf.ecore.EObject) EObjectFlatComboSettings(org.eclipse.emf.eef.runtime.ui.widgets.eobjflatcombo.EObjectFlatComboSettings)

Example 27 with EObjectFlatComboSettings

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

the class ReferenceReferencePropertiesEditionComponent 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 Reference reference = (Reference) elt;
        final ReferencePropertiesEditionPart referencePart = (ReferencePropertiesEditionPart) editingPart;
        // init values
        if (isAccessible(EnvironmentViewsRepository.Reference.Properties.name))
            referencePart.setName(EEFConverterUtil.convertToString(EcorePackage.Literals.ESTRING, reference.getName()));
        if (isAccessible(EnvironmentViewsRepository.Reference.Properties.referencedType)) {
            // init part
            referencedTypeSettings = new EObjectFlatComboSettings(reference, EnvironmentPackage.eINSTANCE.getReference_ReferencedType());
            referencePart.initReferencedType(referencedTypeSettings);
            // set the button mode
            referencePart.setReferencedTypeButtonMode(ButtonsModeEnum.BROWSE);
        }
        if (isAccessible(EnvironmentViewsRepository.Reference.Properties.multiplicity)) {
            referencePart.initMultiplicity(EEFUtils.choiceOfValues(reference, EnvironmentPackage.eINSTANCE.getProperty_Multiplicity()), reference.getMultiplicity());
        }
        if (isAccessible(EnvironmentViewsRepository.Reference.Properties.isComposite)) {
            referencePart.setIsComposite(reference.isIsComposite());
        }
        if (isAccessible(EnvironmentViewsRepository.Reference.Properties.navigable)) {
            referencePart.setNavigable(reference.isNavigable());
        }
        if (isAccessible(EnvironmentViewsRepository.Reference.Properties.oppositeOf)) {
            // init part
            oppositeOfSettings = new EObjectFlatComboSettings(reference, EnvironmentPackage.eINSTANCE.getReference_OppositeOf());
            referencePart.initOppositeOf(oppositeOfSettings);
            // set the button mode
            referencePart.setOppositeOfButtonMode(ButtonsModeEnum.BROWSE);
        }
        if (isAccessible(EnvironmentViewsRepository.Reference.Properties.identifier)) {
            referencePart.setIdentifier(reference.isIsIdentifier());
        }
        if (isAccessible(EnvironmentViewsRepository.Reference.Properties.description))
            referencePart.setDescription(EcoreUtil.convertToString(EcorePackage.Literals.ESTRING, reference.getDescription()));
        if (isAccessible(EnvironmentViewsRepository.Reference.Properties.referencedType)) {
            referencePart.addFilterToReferencedType(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 StructuredType);
                }
            });
        // Start of user code for additional businessfilters for referencedType
        // End of user code
        }
        if (isAccessible(EnvironmentViewsRepository.Reference.Properties.oppositeOf)) {
            referencePart.addFilterToOppositeOf(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 Reference);
                }
            });
        // Start of user code for additional businessfilters for oppositeOf
        // End of user code
        }
    // init values for referenced views
    // init filters for referenced views
    }
    setInitializing(false);
}
Also used : ReferencePropertiesEditionPart(org.obeonetwork.dsl.environment.parts.ReferencePropertiesEditionPart) ViewerFilter(org.eclipse.jface.viewers.ViewerFilter) Reference(org.obeonetwork.dsl.environment.Reference) Viewer(org.eclipse.jface.viewers.Viewer) EObject(org.eclipse.emf.ecore.EObject) EObjectFlatComboSettings(org.eclipse.emf.eef.runtime.ui.widgets.eobjflatcombo.EObjectFlatComboSettings) StructuredType(org.obeonetwork.dsl.environment.StructuredType)

Example 28 with EObjectFlatComboSettings

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

the class InteractionUseInteractionUsePropertiesEditionComponent 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 InteractionUse interactionUse = (InteractionUse) elt;
        final InteractionUsePropertiesEditionPart interactionUsePart = (InteractionUsePropertiesEditionPart) editingPart;
        // init values
        if (isAccessible(InteractionViewsRepository.InteractionUse.Properties.name))
            interactionUsePart.setName(EEFConverterUtil.convertToString(EcorePackage.Literals.ESTRING, interactionUse.getName()));
        if (isAccessible(InteractionViewsRepository.InteractionUse.Properties.type))
            interactionUsePart.setType(EEFConverterUtil.convertToString(EcorePackage.Literals.ESTRING, interactionUse.getType()));
        if (isAccessible(InteractionViewsRepository.InteractionUse.Properties.interaction_)) {
            // init part
            interactionSettings = new EObjectFlatComboSettings(interactionUse, InteractionPackage.eINSTANCE.getInteractionUse_Interaction());
            interactionUsePart.initInteraction(interactionSettings);
            // set the button mode
            interactionUsePart.setInteractionButtonMode(ButtonsModeEnum.BROWSE);
        }
        if (isAccessible(InteractionViewsRepository.InteractionUse.Properties.description))
            interactionUsePart.setDescription(EEFConverterUtil.convertToString(EcorePackage.Literals.ESTRING, interactionUse.getDescription()));
        if (isAccessible(InteractionViewsRepository.InteractionUse.Properties.interaction_)) {
            interactionUsePart.addFilterToInteraction(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 Interaction);
                }
            });
        // Start of user code for additional businessfilters for interaction
        // End of user code
        }
    // init values for referenced views
    // init filters for referenced views
    }
    setInitializing(false);
}
Also used : ViewerFilter(org.eclipse.jface.viewers.ViewerFilter) Interaction(org.obeonetwork.dsl.interaction.Interaction) Viewer(org.eclipse.jface.viewers.Viewer) EObject(org.eclipse.emf.ecore.EObject) EObjectFlatComboSettings(org.eclipse.emf.eef.runtime.ui.widgets.eobjflatcombo.EObjectFlatComboSettings) InteractionUsePropertiesEditionPart(org.obeonetwork.dsl.interaction.parts.InteractionUsePropertiesEditionPart) InteractionUse(org.obeonetwork.dsl.interaction.InteractionUse)

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