Search in sources :

Example 1 with EClass

use of org.eclipse.emf.ecore.EClass in project tdi-studio-se by Talend.

the class BusinessProcessCanonicalEditPolicy method storeLinks.

/**
     * @generated
     */
private void storeLinks(EObject container, Diagram diagram) {
    EClass containerMetaclass = container.eClass();
    storeFeatureModelFacetLinks(container, containerMetaclass, diagram);
    storeTypeModelFacetLinks(container, containerMetaclass);
}
Also used : EClass(org.eclipse.emf.ecore.EClass)

Example 2 with EClass

use of org.eclipse.emf.ecore.EClass in project tdi-studio-se by Talend.

the class BusinessViewProvider method getEdgeViewClass.

/**
     * @generated
     */
protected Class getEdgeViewClass(IAdaptable semanticAdapter, View containerView, String semanticHint) {
    IElementType elementType = getSemanticElementType(semanticAdapter);
    if (elementType != null && !BusinessElementTypes.isKnownElementType(elementType)) {
        return null;
    }
    EClass semanticType = getSemanticEClass(semanticAdapter);
    if (semanticType == null) {
        return null;
    }
    EObject semanticElement = getSemanticElement(semanticAdapter);
    int linkVID = BusinessVisualIDRegistry.getLinkWithClassVisualID(semanticElement, semanticType);
    switch(linkVID) {
        case BusinessItemRelationshipEditPart.VISUAL_ID:
            return BusinessItemRelationshipViewFactory.class;
        case DirectionalBusinessItemRelationshipEditPart.VISUAL_ID:
            return DirectionalBusinessItemRelationshipViewFactory.class;
        case BidirectionalBusinessItemRelationshipEditPart.VISUAL_ID:
            return BidirectionalBusinessItemRelationshipViewFactory.class;
    }
    return getUnrecognizedConnectorViewClass(semanticAdapter, containerView, semanticHint);
}
Also used : IElementType(org.eclipse.gmf.runtime.emf.type.core.IElementType) DirectionalBusinessItemRelationshipViewFactory(org.talend.designer.business.model.business.diagram.view.factories.DirectionalBusinessItemRelationshipViewFactory) BidirectionalBusinessItemRelationshipViewFactory(org.talend.designer.business.model.business.diagram.view.factories.BidirectionalBusinessItemRelationshipViewFactory) BusinessItemRelationshipViewFactory(org.talend.designer.business.model.business.diagram.view.factories.BusinessItemRelationshipViewFactory) DirectionalBusinessItemRelationshipViewFactory(org.talend.designer.business.model.business.diagram.view.factories.DirectionalBusinessItemRelationshipViewFactory) EClass(org.eclipse.emf.ecore.EClass) EObject(org.eclipse.emf.ecore.EObject) BidirectionalBusinessItemRelationshipViewFactory(org.talend.designer.business.model.business.diagram.view.factories.BidirectionalBusinessItemRelationshipViewFactory)

Example 3 with EClass

use of org.eclipse.emf.ecore.EClass in project tdi-studio-se by Talend.

the class JSONRepositoryContentHandler method save.

@Override
public Resource save(Item item) throws PersistenceException {
    Resource itemResource = null;
    EClass eClass = item.eClass();
    if (eClass.eContainer() == JsonPackage.eINSTANCE) {
        switch(eClass.getClassifierID()) {
            case JsonPackage.JSON_FILE_CONNECTION_ITEM:
                itemResource = save((JSONFileConnectionItem) item);
                return itemResource;
            default:
                return null;
        }
    }
    return null;
}
Also used : EClass(org.eclipse.emf.ecore.EClass) Resource(org.eclipse.emf.ecore.resource.Resource) JSONFileConnectionItem(org.talend.repository.model.json.JSONFileConnectionItem)

Example 4 with EClass

use of org.eclipse.emf.ecore.EClass in project benchmarx by eMoflon.

the class ChangeRecorder method WriteFullElement.

private void WriteFullElement(EObject element, String type) {
    buffer.append("\t\t<");
    buffer.append(type);
    buffer.append(" xsi:type=\"");
    EClass eClass = element.eClass();
    EPackage ePackage = (EPackage) eClass.eContainer();
    buffer.append(ePackage.getNsPrefix());
    buffer.append(":");
    buffer.append(eClass.getName());
    buffer.append("\" xmlns:");
    buffer.append(ePackage.getNsPrefix());
    buffer.append("=\"");
    buffer.append(ePackage.getNsURI());
    buffer.append("\"");
    for (EAttribute att : eClass.getEAllAttributes()) {
        if (element.eIsSet(att)) {
            Object value = element.eGet(att);
            WriteAttribute(att.getName(), toCompatibleString(value));
        }
    }
    buffer.append(" />\n");
    this.RegisterNewElement(element, this.changeCounter, type);
}
Also used : EClass(org.eclipse.emf.ecore.EClass) EAttribute(org.eclipse.emf.ecore.EAttribute) EObject(org.eclipse.emf.ecore.EObject) EPackage(org.eclipse.emf.ecore.EPackage)

Example 5 with EClass

use of org.eclipse.emf.ecore.EClass in project openhab1-addons by openhab.

the class ConfigurationHandler method checkTfType.

/**
     * Checks if the {@code deviceType} is known by the {@link Ecosystem}.
     *
     * @param ohId The name of the device found in openhab.cfg as {@code String}.
     * @param deviceType The device type found in openhab.cfg as {@code String}.
     * @throws ConfigurationException
     */
private void checkTfType(String ohId, String deviceType) throws ConfigurationException {
    ModelPackage modelPackage = ModelPackage.eINSTANCE;
    boolean deviceFound = false;
    for (EClassifier eClassifier : modelPackage.getEClassifiers()) {
        if (eClassifier instanceof EClass) {
            EList<EAttribute> attributes = ((EClass) eClassifier).getEAllAttributes();
            for (EAttribute attribute : attributes) {
                if (attribute.getName().equals("deviceType")) {
                    if (attribute.getDefaultValueLiteral().equals(deviceType)) {
                        deviceFound = true;
                        break;
                    }
                }
            }
        }
    }
    if (!deviceFound) {
        throw new ConfigurationException(ohId, "unknown device type: " + deviceType);
    }
}
Also used : EClass(org.eclipse.emf.ecore.EClass) EAttribute(org.eclipse.emf.ecore.EAttribute) ConfigurationException(org.osgi.service.cm.ConfigurationException) ModelPackage(org.openhab.binding.tinkerforge.internal.model.ModelPackage) EClassifier(org.eclipse.emf.ecore.EClassifier)

Aggregations

EClass (org.eclipse.emf.ecore.EClass)11 Model (org.applause.lang.applauseDsl.Model)3 EObject (org.eclipse.emf.ecore.EObject)3 EAttribute (org.eclipse.emf.ecore.EAttribute)2 IElementType (org.eclipse.gmf.runtime.emf.type.core.IElementType)2 EClassifier (org.eclipse.emf.ecore.EClassifier)1 EPackage (org.eclipse.emf.ecore.EPackage)1 Resource (org.eclipse.emf.ecore.resource.Resource)1 QualifiedName (org.eclipse.xtext.naming.QualifiedName)1 IEObjectDescription (org.eclipse.xtext.resource.IEObjectDescription)1 IScope (org.eclipse.xtext.scoping.IScope)1 ModelPackage (org.openhab.binding.tinkerforge.internal.model.ModelPackage)1 ConfigurationException (org.osgi.service.cm.ConfigurationException)1 Item (org.talend.core.model.properties.Item)1 Property (org.talend.core.model.properties.Property)1 SAPConnectionItem (org.talend.core.model.properties.SAPConnectionItem)1 ERepositoryObjectType (org.talend.core.model.repository.ERepositoryObjectType)1 IRepositoryViewObject (org.talend.core.model.repository.IRepositoryViewObject)1 MetadataTableRepositoryObject (org.talend.core.repository.model.repositoryObject.MetadataTableRepositoryObject)1 SAPFunctionRepositoryObject (org.talend.core.repository.model.repositoryObject.SAPFunctionRepositoryObject)1