Search in sources :

Example 1 with CSSModelImpl

use of org.eclipse.wst.css.core.internal.document.CSSModelImpl in project webtools.sourceediting by eclipse.

the class AbstractCSSModelAdapter method createModel.

/**
 */
protected ICSSModel createModel() {
    // create embedded CSS model (not for external CSS)
    Element element = getElement();
    if (element == null)
        return null;
    String contentType = null;
    if (element instanceof ElementStyleImpl) {
        contentType = ((ElementStyleImpl) element).getEmbeddedStyleType();
    }
    IStructuredModel baseModel = ((IDOMNode) element).getModel();
    ICSSModel newModel = (ICSSModel) baseModel.getModelManager().createUnManagedStructuredModelFor(contentType != null ? contentType : CSS_ID);
    ((CSSModelImpl) newModel).setOwnerDOMNode(element);
    return newModel;
}
Also used : ElementStyleImpl(org.eclipse.wst.html.core.internal.document.ElementStyleImpl) IDOMNode(org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode) ICSSModel(org.eclipse.wst.css.core.internal.provisional.document.ICSSModel) Element(org.w3c.dom.Element) IStructuredModel(org.eclipse.wst.sse.core.internal.provisional.IStructuredModel) CSSModelImpl(org.eclipse.wst.css.core.internal.document.CSSModelImpl)

Aggregations

CSSModelImpl (org.eclipse.wst.css.core.internal.document.CSSModelImpl)1 ICSSModel (org.eclipse.wst.css.core.internal.provisional.document.ICSSModel)1 ElementStyleImpl (org.eclipse.wst.html.core.internal.document.ElementStyleImpl)1 IStructuredModel (org.eclipse.wst.sse.core.internal.provisional.IStructuredModel)1 IDOMNode (org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode)1 Element (org.w3c.dom.Element)1