Search in sources :

Example 1 with ExternalCriterion

use of org.obeonetwork.dsl.entity.ExternalCriterion in project InformationSystem by ObeoNetwork.

the class ExternalCriterionExternalCriterionPropertiesEditionComponent 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 ExternalCriterion externalCriterion = (ExternalCriterion) elt;
        final ExternalCriterionPropertiesEditionPart externalCriterionPart = (ExternalCriterionPropertiesEditionPart) editingPart;
        // init values
        if (isAccessible(EntityViewsRepository.ExternalCriterion.Properties.name))
            externalCriterionPart.setName(EEFConverterUtil.convertToString(EcorePackage.Literals.ESTRING, externalCriterion.getName()));
        if (isAccessible(EntityViewsRepository.ExternalCriterion.Properties.type)) {
            // init part
            typeSettings = new EObjectFlatComboSettings(externalCriterion, EntityPackage.eINSTANCE.getExternalCriterion_Type());
            externalCriterionPart.initType(typeSettings);
            // set the button mode
            externalCriterionPart.setTypeButtonMode(ButtonsModeEnum.BROWSE);
        }
        if (isAccessible(EntityViewsRepository.ExternalCriterion.Properties.description))
            externalCriterionPart.setDescription(EcoreUtil.convertToString(EcorePackage.Literals.ESTRING, externalCriterion.getDescription()));
    // init filters
    // init values for referenced views
    // init filters for referenced views
    }
    setInitializing(false);
}
Also used : ExternalCriterionPropertiesEditionPart(org.obeonetwork.dsl.entity.parts.ExternalCriterionPropertiesEditionPart) EObjectFlatComboSettings(org.eclipse.emf.eef.runtime.ui.widgets.eobjflatcombo.EObjectFlatComboSettings) ExternalCriterion(org.obeonetwork.dsl.entity.ExternalCriterion)

Example 2 with ExternalCriterion

use of org.obeonetwork.dsl.entity.ExternalCriterion in project InformationSystem by ObeoNetwork.

the class FinderImpl method getName.

/**
 * <!-- begin-user-doc --> <!-- end-user-doc -->
 *
 * @generated NOT
 */
public String getName() {
    String result = "";
    String customizedName = getCustomizedName();
    if ((customizedName != null) && (!customizedName.equals(""))) {
        result = customizedName;
    } else {
        result = "finder : ";
        EList<Criterion> listCriterions = getCriterions();
        if (listCriterions != null) {
            for (Iterator<Criterion> iter = listCriterions.iterator(); iter.hasNext(); ) {
                Criterion criterion = (Criterion) iter.next();
                if (criterion instanceof InternalCriterion) {
                    InternalCriterion internalCriterion = (InternalCriterion) criterion;
                    result += internalCriterion.getName();
                } else if (criterion instanceof ExternalCriterion) {
                    ExternalCriterion externalCriterion = (ExternalCriterion) criterion;
                    result += externalCriterion.getName();
                } else
                    result += criterion.toString();
                if (iter.hasNext())
                    result += ", ";
            }
        }
    }
    return result;
}
Also used : Criterion(org.obeonetwork.dsl.entity.Criterion) ExternalCriterion(org.obeonetwork.dsl.entity.ExternalCriterion) InternalCriterion(org.obeonetwork.dsl.entity.InternalCriterion) InternalCriterion(org.obeonetwork.dsl.entity.InternalCriterion) ExternalCriterion(org.obeonetwork.dsl.entity.ExternalCriterion)

Aggregations

ExternalCriterion (org.obeonetwork.dsl.entity.ExternalCriterion)2 EObjectFlatComboSettings (org.eclipse.emf.eef.runtime.ui.widgets.eobjflatcombo.EObjectFlatComboSettings)1 Criterion (org.obeonetwork.dsl.entity.Criterion)1 InternalCriterion (org.obeonetwork.dsl.entity.InternalCriterion)1 ExternalCriterionPropertiesEditionPart (org.obeonetwork.dsl.entity.parts.ExternalCriterionPropertiesEditionPart)1