Search in sources :

Example 6 with DTDEntity

use of org.eclipse.wst.dtd.core.internal.emf.DTDEntity in project webtools.sourceediting by eclipse.

the class DTDAttributeImpl method basicSetAttributeTypeReferencedEntity.

/**
 * <!-- begin-user-doc --> <!-- end-user-doc -->
 * @generated
 */
public NotificationChain basicSetAttributeTypeReferencedEntity(DTDEntity newAttributeTypeReferencedEntity, NotificationChain msgs) {
    DTDEntity oldAttributeTypeReferencedEntity = attributeTypeReferencedEntity;
    attributeTypeReferencedEntity = newAttributeTypeReferencedEntity;
    if (eNotificationRequired()) {
        ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, DTDPackage.DTD_ATTRIBUTE__ATTRIBUTE_TYPE_REFERENCED_ENTITY, oldAttributeTypeReferencedEntity, newAttributeTypeReferencedEntity);
        if (msgs == null)
            msgs = notification;
        else
            msgs.add(notification);
    }
    return msgs;
}
Also used : ENotificationImpl(org.eclipse.emf.ecore.impl.ENotificationImpl) DTDEntity(org.eclipse.wst.dtd.core.internal.emf.DTDEntity)

Example 7 with DTDEntity

use of org.eclipse.wst.dtd.core.internal.emf.DTDEntity in project webtools.sourceediting by eclipse.

the class DTDParameterEntityReferenceImpl method basicSetEntity.

/**
 * <!-- begin-user-doc --> <!-- end-user-doc -->
 * @generated
 */
public NotificationChain basicSetEntity(DTDEntity newEntity, NotificationChain msgs) {
    DTDEntity oldEntity = entity;
    entity = newEntity;
    if (eNotificationRequired()) {
        ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, DTDPackage.DTD_PARAMETER_ENTITY_REFERENCE__ENTITY, oldEntity, newEntity);
        if (msgs == null)
            msgs = notification;
        else
            msgs.add(notification);
    }
    return msgs;
}
Also used : ENotificationImpl(org.eclipse.emf.ecore.impl.ENotificationImpl) DTDEntity(org.eclipse.wst.dtd.core.internal.emf.DTDEntity)

Example 8 with DTDEntity

use of org.eclipse.wst.dtd.core.internal.emf.DTDEntity in project webtools.sourceediting by eclipse.

the class DTDAttributeImpl method basicSetAttributeNameReferencedEntity.

/**
 * <!-- begin-user-doc --> <!-- end-user-doc -->
 * @generated
 */
public NotificationChain basicSetAttributeNameReferencedEntity(DTDEntity newAttributeNameReferencedEntity, NotificationChain msgs) {
    DTDEntity oldAttributeNameReferencedEntity = attributeNameReferencedEntity;
    attributeNameReferencedEntity = newAttributeNameReferencedEntity;
    if (eNotificationRequired()) {
        ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, DTDPackage.DTD_ATTRIBUTE__ATTRIBUTE_NAME_REFERENCED_ENTITY, oldAttributeNameReferencedEntity, newAttributeNameReferencedEntity);
        if (msgs == null)
            msgs = notification;
        else
            msgs.add(notification);
    }
    return msgs;
}
Also used : ENotificationImpl(org.eclipse.emf.ecore.impl.ENotificationImpl) DTDEntity(org.eclipse.wst.dtd.core.internal.emf.DTDEntity)

Example 9 with DTDEntity

use of org.eclipse.wst.dtd.core.internal.emf.DTDEntity in project webtools.sourceediting by eclipse.

the class DTDUtil method loadIncludedDTD.

// load xmiModels for included DTDs
private void loadIncludedDTD(ResourceSet resources, DTD dtd) {
    ExternalDTDModel extModel = getExternalDTDModel(resources, dtd.getName());
    if (extModel != null) {
        // now fill our hash tables for elements and parameter entities
        // so that we know what can be referenced by our main dtd
        DTDFile file = extModel.getExternalDTDFile();
        Collection elementList = file.listDTDElement();
        Collection entityList = file.listDTDEntity();
        Iterator i = elementList.iterator();
        while (i.hasNext()) {
            DTDObject object = (DTDObject) i.next();
            elementPool.put(getBaseName(object), object);
        }
        i = entityList.iterator();
        while (i.hasNext()) {
            DTDEntity entity = (DTDEntity) i.next();
            if (entity.isParameterEntity()) {
                pePool.put(getBaseName(entity), entity);
            }
        }
    }
}
Also used : Iterator(java.util.Iterator) Collection(java.util.Collection) DTDEntity(org.eclipse.wst.dtd.core.internal.emf.DTDEntity) DTDFile(org.eclipse.wst.dtd.core.internal.emf.DTDFile) DTDObject(org.eclipse.wst.dtd.core.internal.emf.DTDObject)

Example 10 with DTDEntity

use of org.eclipse.wst.dtd.core.internal.emf.DTDEntity in project webtools.sourceediting by eclipse.

the class DTDUtil method getName.

// This gets the name with pseudo namespace prefixes if dtdFile is not
// null
public static String getName(DTDObject obj, DTDFile dtdFile) {
    // $NON-NLS-1$
    String name = "";
    if (obj instanceof DTDEntity) {
        DTDEntity entity = (DTDEntity) obj;
        if (dtdFile != null && !entity.getDTDFile().equals(dtdFile)) {
            // $NON-NLS-1$
            name = new Path(entity.getDTDFile().getName()).lastSegment() + ": ";
        }
        // $NON-NLS-1$ //$NON-NLS-2$
        name += "%" + ((DTDEntity) obj).getName() + ";";
    } else if (obj instanceof DTDElement) {
        DTDElement element = (DTDElement) obj;
        if (dtdFile != null && !element.getDTDFile().equals(dtdFile)) {
            // $NON-NLS-1$
            name = new Path(element.getDTDFile().getName()).lastSegment() + ": ";
        }
        name += ((DTDElement) obj).getName();
    } else if (obj instanceof DTDElementContent) {
        return ((DTDElementContent) obj).getContentName();
    }
    return name;
}
Also used : IPath(org.eclipse.core.runtime.IPath) Path(org.eclipse.core.runtime.Path) DTDElementContent(org.eclipse.wst.dtd.core.internal.emf.DTDElementContent) DTDElement(org.eclipse.wst.dtd.core.internal.emf.DTDElement) DTDEntity(org.eclipse.wst.dtd.core.internal.emf.DTDEntity)

Aggregations

DTDEntity (org.eclipse.wst.dtd.core.internal.emf.DTDEntity)14 ENotificationImpl (org.eclipse.emf.ecore.impl.ENotificationImpl)4 DTDElement (org.eclipse.wst.dtd.core.internal.emf.DTDElement)3 DTDElementReferenceContent (org.eclipse.wst.dtd.core.internal.emf.DTDElementReferenceContent)2 DTDEntityReferenceContent (org.eclipse.wst.dtd.core.internal.emf.DTDEntityReferenceContent)2 DTDGroupContent (org.eclipse.wst.dtd.core.internal.emf.DTDGroupContent)2 DTDGroupKind (org.eclipse.wst.dtd.core.internal.emf.DTDGroupKind)2 DTDOccurrenceType (org.eclipse.wst.dtd.core.internal.emf.DTDOccurrenceType)2 DTDPCDataContent (org.eclipse.wst.dtd.core.internal.emf.DTDPCDataContent)2 CMBasicNode (org.eclipse.wst.dtd.core.internal.saxparser.CMBasicNode)2 CMGroupNode (org.eclipse.wst.dtd.core.internal.saxparser.CMGroupNode)2 CMNode (org.eclipse.wst.dtd.core.internal.saxparser.CMNode)2 CMReferenceNode (org.eclipse.wst.dtd.core.internal.saxparser.CMReferenceNode)2 Collection (java.util.Collection)1 Enumeration (java.util.Enumeration)1 Iterator (java.util.Iterator)1 IPath (org.eclipse.core.runtime.IPath)1 Path (org.eclipse.core.runtime.Path)1 DTDAnyContent (org.eclipse.wst.dtd.core.internal.emf.DTDAnyContent)1 DTDBasicType (org.eclipse.wst.dtd.core.internal.emf.DTDBasicType)1