Search in sources :

Example 1 with DomainClassPropertiesEditionPart

use of org.obeonetwork.graal.parts.DomainClassPropertiesEditionPart in project InformationSystem by ObeoNetwork.

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

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 DomainClass (org.obeonetwork.graal.DomainClass)1 DomainClassPropertiesEditionPart (org.obeonetwork.graal.parts.DomainClassPropertiesEditionPart)1