Search in sources :

Example 1 with EntityPropertiesEditionPart

use of org.obeonetwork.dsl.entity.parts.EntityPropertiesEditionPart 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)

Aggregations

EObjectFilter (org.eclipse.emf.eef.runtime.impl.filters.EObjectFilter)1 EObjectFlatComboSettings (org.eclipse.emf.eef.runtime.ui.widgets.eobjflatcombo.EObjectFlatComboSettings)1 ReferencesTableSettings (org.eclipse.emf.eef.runtime.ui.widgets.referencestable.ReferencesTableSettings)1 Entity (org.obeonetwork.dsl.entity.Entity)1 EntityPropertiesEditionPart (org.obeonetwork.dsl.entity.parts.EntityPropertiesEditionPart)1