Search in sources :

Example 1 with ParameterPropertiesEditionPart

use of org.obeonetwork.dsl.soa.parts.ParameterPropertiesEditionPart in project InformationSystem by ObeoNetwork.

the class ParameterParameterPropertiesEditionComponent 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 Parameter parameter = (Parameter) elt;
        final ParameterPropertiesEditionPart parameterPart = (ParameterPropertiesEditionPart) editingPart;
        // init values
        if (isAccessible(SoaViewsRepository.Parameter.Properties.name))
            parameterPart.setName(EEFConverterUtil.convertToString(EcorePackage.Literals.ESTRING, parameter.getName()));
        if (isAccessible(SoaViewsRepository.Parameter.Properties.multiplicity)) {
            parameterPart.initMultiplicity(EEFUtils.choiceOfValues(parameter, SoaPackage.eINSTANCE.getParameter_Multiplicity()), parameter.getMultiplicity());
        }
        if (isAccessible(SoaViewsRepository.Parameter.Properties.isUnique)) {
            parameterPart.setIsUnique(parameter.isIsUnique());
        }
        if (isAccessible(SoaViewsRepository.Parameter.Properties.isOrdered)) {
            parameterPart.setIsOrdered(parameter.isIsOrdered());
        }
        if (isAccessible(SoaViewsRepository.Parameter.Properties.type)) {
            // init part
            typeSettings = new EObjectFlatComboSettings(parameter, SoaPackage.eINSTANCE.getParameter_Type());
            parameterPart.initType(typeSettings);
            // set the button mode
            parameterPart.setTypeButtonMode(ButtonsModeEnum.BROWSE);
        }
        if (isAccessible(SoaViewsRepository.Parameter.Properties.description))
            parameterPart.setDescription(EcoreUtil.convertToString(EcorePackage.Literals.ESTRING, parameter.getDescription()));
    // init filters
    // init values for referenced views
    // init filters for referenced views
    }
    setInitializing(false);
}
Also used : Parameter(org.obeonetwork.dsl.soa.Parameter) EObjectFlatComboSettings(org.eclipse.emf.eef.runtime.ui.widgets.eobjflatcombo.EObjectFlatComboSettings) ParameterPropertiesEditionPart(org.obeonetwork.dsl.soa.parts.ParameterPropertiesEditionPart)

Aggregations

EObjectFlatComboSettings (org.eclipse.emf.eef.runtime.ui.widgets.eobjflatcombo.EObjectFlatComboSettings)1 Parameter (org.obeonetwork.dsl.soa.Parameter)1 ParameterPropertiesEditionPart (org.obeonetwork.dsl.soa.parts.ParameterPropertiesEditionPart)1