Search in sources :

Example 11 with EObjectFlatComboSettings

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

the class UserDefinedTypeRefPropertiesEditionComponent 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 UserDefinedTypeRef userDefinedTypeRef = (UserDefinedTypeRef) elt;
        final UserDefinedTypeRefPropertiesEditionPart userDefinedTypeRefPart = (UserDefinedTypeRefPropertiesEditionPart) editingPart;
        // init values
        if (isAccessible(TypeslibraryViewsRepository.UserDefinedTypeRef.Properties.type)) {
            // init part
            typeSettings = new EObjectFlatComboSettings(userDefinedTypeRef, TypesLibraryPackage.eINSTANCE.getUserDefinedTypeRef_Type());
            userDefinedTypeRefPart.initType(typeSettings);
            // set the button mode
            userDefinedTypeRefPart.setTypeButtonMode(ButtonsModeEnum.BROWSE);
        }
        // init filters
        if (isAccessible(TypeslibraryViewsRepository.UserDefinedTypeRef.Properties.type)) {
            userDefinedTypeRefPart.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) {
                    return (element instanceof UserDefinedType);
                }
            });
        // 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 : ViewerFilter(org.eclipse.jface.viewers.ViewerFilter) UserDefinedType(org.obeonetwork.dsl.typeslibrary.UserDefinedType) Viewer(org.eclipse.jface.viewers.Viewer) EObject(org.eclipse.emf.ecore.EObject) EObjectFlatComboSettings(org.eclipse.emf.eef.runtime.ui.widgets.eobjflatcombo.EObjectFlatComboSettings) UserDefinedTypeRefPropertiesEditionPart(org.obeonetwork.dsl.typeslibrary.parts.UserDefinedTypeRefPropertiesEditionPart) UserDefinedTypeRef(org.obeonetwork.dsl.typeslibrary.UserDefinedTypeRef)

Example 12 with EObjectFlatComboSettings

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

the class NativeTypePropertiesEditionComponent 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 NativeType nativeType = (NativeType) elt;
        final NativeTypePropertiesEditionPart nativeTypePart = (NativeTypePropertiesEditionPart) editingPart;
        // init values
        if (isAccessible(TypeslibraryViewsRepository.NativeType.Properties.name))
            nativeTypePart.setName(EEFConverterUtil.convertToString(EcorePackage.Literals.ESTRING, nativeType.getName()));
        if (isAccessible(TypeslibraryViewsRepository.NativeType.Properties.spec)) {
            nativeTypePart.initSpec(EEFUtils.choiceOfValues(nativeType, TypesLibraryPackage.eINSTANCE.getNativeType_Spec()), nativeType.getSpec());
        }
        if (isAccessible(TypeslibraryViewsRepository.NativeType.Properties.mapsTo)) {
            // init part
            mapsToSettings = new EObjectFlatComboSettings(nativeType, TypesLibraryPackage.eINSTANCE.getNativeType_MapsTo());
            nativeTypePart.initMapsTo(mapsToSettings);
            // set the button mode
            nativeTypePart.setMapsToButtonMode(ButtonsModeEnum.BROWSE);
        }
        if (isAccessible(TypeslibraryViewsRepository.NativeType.Properties.mapsTo)) {
            nativeTypePart.addFilterToMapsTo(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 NativeType);
                }
            });
        // Start of user code for additional businessfilters for mapsTo
        // End of user code
        }
    // init values for referenced views
    // init filters for referenced views
    }
    setInitializing(false);
}
Also used : ViewerFilter(org.eclipse.jface.viewers.ViewerFilter) NativeTypePropertiesEditionPart(org.obeonetwork.dsl.typeslibrary.parts.NativeTypePropertiesEditionPart) NativeType(org.obeonetwork.dsl.typeslibrary.NativeType) Viewer(org.eclipse.jface.viewers.Viewer) EObject(org.eclipse.emf.ecore.EObject) EObjectFlatComboSettings(org.eclipse.emf.eef.runtime.ui.widgets.eobjflatcombo.EObjectFlatComboSettings)

Example 13 with EObjectFlatComboSettings

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

the class EntityEntityPropertiesEditionComponent 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 Entity entity = (Entity) elt;
        final EntityPropertiesEditionPart entityPart = (EntityPropertiesEditionPart) editingPart;
        // init values
        if (isAccessible(EntityViewsRepository.Entity_.Properties.name))
            entityPart.setName(EEFConverterUtil.convertToString(EcorePackage.Literals.ESTRING, entity.getName()));
        if (isAccessible(EntityViewsRepository.Entity_.Properties.superType)) {
            // init part
            superTypeSettings = new EObjectFlatComboSettings(entity, EnvironmentPackage.eINSTANCE.getStructuredType_Supertype());
            entityPart.initSuperType(superTypeSettings);
            // set the button mode
            entityPart.setSuperTypeButtonMode(ButtonsModeEnum.BROWSE);
        }
        if (isAccessible(EntityViewsRepository.Entity_.Properties.description))
            entityPart.setDescription(EcoreUtil.convertToString(EcorePackage.Literals.ESTRING, entity.getDescription()));
        if (isAccessible(EntityViewsRepository.Entity_.Properties.associatedTypes)) {
            associatedTypesSettings = new ReferencesTableSettings(entity, EnvironmentPackage.eINSTANCE.getStructuredType_AssociatedTypes());
            entityPart.initAssociatedTypes(associatedTypesSettings);
        }
        if (isAccessible(EntityViewsRepository.Entity_.Properties.associatedTypes)) {
            entityPart.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) Entity(org.obeonetwork.dsl.entity.Entity) EntityPropertiesEditionPart(org.obeonetwork.dsl.entity.parts.EntityPropertiesEditionPart) ReferencesTableSettings(org.eclipse.emf.eef.runtime.ui.widgets.referencestable.ReferencesTableSettings) EObjectFlatComboSettings(org.eclipse.emf.eef.runtime.ui.widgets.eobjflatcombo.EObjectFlatComboSettings)

Example 14 with EObjectFlatComboSettings

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

the class ViewContainerReferenceViewContainerReferencePropertiesEditionComponent 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 ViewContainerReference viewContainerReference = (ViewContainerReference) elt;
        final ViewContainerReferencePropertiesEditionPart viewContainerReferencePart = (ViewContainerReferencePropertiesEditionPart) editingPart;
        // init values
        if (isAccessible(ViewViewsRepository.ViewContainerReference.Properties.description))
            viewContainerReferencePart.setDescription(EcoreUtil.convertToString(EcorePackage.Literals.ESTRING, viewContainerReference.getDescription()));
        if (isAccessible(ViewViewsRepository.ViewContainerReference.Properties.name))
            viewContainerReferencePart.setName(EEFConverterUtil.convertToString(EcorePackage.Literals.ESTRING, viewContainerReference.getName()));
        if (isAccessible(ViewViewsRepository.ViewContainerReference.Properties.widget)) {
            // init part
            widgetSettings = new EObjectFlatComboSettings(viewContainerReference, ViewPackage.eINSTANCE.getAbstractViewElement_Widget());
            viewContainerReferencePart.initWidget(widgetSettings);
            // set the button mode
            viewContainerReferencePart.setWidgetButtonMode(ButtonsModeEnum.BROWSE);
        }
        if (isAccessible(ViewViewsRepository.ViewContainerReference.Properties.actions)) {
            actionsSettings = new ReferencesTableSettings(viewContainerReference, ViewPackage.eINSTANCE.getAbstractViewElement_Actions());
            viewContainerReferencePart.initActions(actionsSettings);
        }
        if (isAccessible(ViewViewsRepository.ViewContainerReference.Properties.events)) {
            eventsSettings = new ReferencesTableSettings(viewContainerReference, ViewPackage.eINSTANCE.getAbstractViewElement_Events());
            viewContainerReferencePart.initEvents(eventsSettings);
        }
        if (isAccessible(ViewViewsRepository.ViewContainerReference.Properties.label))
            viewContainerReferencePart.setLabel(EEFConverterUtil.convertToString(EcorePackage.Literals.ESTRING, viewContainerReference.getLabel()));
        if (isAccessible(ViewViewsRepository.ViewContainerReference.Properties.viewContainer)) {
            // init part
            viewContainerSettings = new EObjectFlatComboSettings(viewContainerReference, ViewPackage.eINSTANCE.getViewContainerReference_ViewContainer());
            viewContainerReferencePart.initViewContainer(viewContainerSettings);
            // set the button mode
            viewContainerReferencePart.setViewContainerButtonMode(ButtonsModeEnum.BROWSE);
        }
        if (isAccessible(ViewViewsRepository.ViewContainerReference.Properties.widget)) {
            viewContainerReferencePart.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.ViewContainerReference.Properties.actions)) {
            viewContainerReferencePart.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.ViewContainerReference.Properties.events)) {
            viewContainerReferencePart.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.ViewContainerReference.Properties.viewContainer)) {
            viewContainerReferencePart.addFilterToViewContainer(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 ViewContainer);
                }
            });
        // Start of user code for additional businessfilters for viewContainer
        // End of user code
        }
    // init values for referenced views
    // init filters for referenced views
    }
    setInitializing(false);
}
Also used : ViewContainerReferencePropertiesEditionPart(org.obeonetwork.dsl.cinematic.view.parts.ViewContainerReferencePropertiesEditionPart) ViewContainerReference(org.obeonetwork.dsl.cinematic.view.ViewContainerReference) 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) ViewContainer(org.obeonetwork.dsl.cinematic.view.ViewContainer)

Example 15 with EObjectFlatComboSettings

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

the class ViewContainerViewContainerPropertiesEditionComponent 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 ViewContainer viewContainer = (ViewContainer) elt;
        final ViewContainerPropertiesEditionPart viewContainerPart = (ViewContainerPropertiesEditionPart) editingPart;
        // init values
        if (isAccessible(ViewViewsRepository.ViewContainer.Properties.description))
            viewContainerPart.setDescription(EcoreUtil.convertToString(EcorePackage.Literals.ESTRING, viewContainer.getDescription()));
        if (isAccessible(ViewViewsRepository.ViewContainer.Properties.name))
            viewContainerPart.setName(EEFConverterUtil.convertToString(EcorePackage.Literals.ESTRING, viewContainer.getName()));
        if (isAccessible(ViewViewsRepository.ViewContainer.Properties.widget)) {
            // init part
            widgetSettings = new EObjectFlatComboSettings(viewContainer, ViewPackage.eINSTANCE.getAbstractViewElement_Widget());
            viewContainerPart.initWidget(widgetSettings);
            // set the button mode
            viewContainerPart.setWidgetButtonMode(ButtonsModeEnum.BROWSE);
        }
        if (isAccessible(ViewViewsRepository.ViewContainer.Properties.actions)) {
            actionsSettings = new ReferencesTableSettings(viewContainer, ViewPackage.eINSTANCE.getAbstractViewElement_Actions());
            viewContainerPart.initActions(actionsSettings);
        }
        if (isAccessible(ViewViewsRepository.ViewContainer.Properties.events)) {
            eventsSettings = new ReferencesTableSettings(viewContainer, ViewPackage.eINSTANCE.getAbstractViewElement_Events());
            viewContainerPart.initEvents(eventsSettings);
        }
        if (isAccessible(ViewViewsRepository.ViewContainer.Properties.label))
            viewContainerPart.setLabel(EEFConverterUtil.convertToString(EcorePackage.Literals.ESTRING, viewContainer.getLabel()));
        if (isAccessible(ViewViewsRepository.ViewContainer.Properties.ownedElements)) {
            ownedElementsSettings = new ReferencesTableSettings(viewContainer, ViewPackage.eINSTANCE.getViewContainer_OwnedElements());
            viewContainerPart.initOwnedElements(ownedElementsSettings);
        }
        if (isAccessible(ViewViewsRepository.ViewContainer.Properties.widget)) {
            viewContainerPart.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.ViewContainer.Properties.actions)) {
            viewContainerPart.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.ViewContainer.Properties.events)) {
            viewContainerPart.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.ViewContainer.Properties.ownedElements)) {
            viewContainerPart.addFilterToOwnedElements(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 AbstractViewElement);
                }
            });
        // Start of user code for additional businessfilters for ownedElements
        // End of user code
        }
    // init values for referenced views
    // init filters for referenced views
    }
    setInitializing(false);
}
Also used : ViewContainerPropertiesEditionPart(org.obeonetwork.dsl.cinematic.view.parts.ViewContainerPropertiesEditionPart) ReferencesTableSettings(org.eclipse.emf.eef.runtime.ui.widgets.referencestable.ReferencesTableSettings) AbstractViewElement(org.obeonetwork.dsl.cinematic.view.AbstractViewElement) 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) ViewContainer(org.obeonetwork.dsl.cinematic.view.ViewContainer)

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