Search in sources :

Example 1 with IStyleDeclarationAdapter

use of org.eclipse.wst.css.core.internal.provisional.adapters.IStyleDeclarationAdapter in project webtools.sourceediting by eclipse.

the class ElementNodeCleanupHandler method getCSSModel.

/**
 */
private ICSSModel getCSSModel(Attr attr) {
    if (attr == null)
        return null;
    INodeNotifier notifier = (INodeNotifier) attr.getOwnerElement();
    if (notifier == null)
        return null;
    INodeAdapter adapter = notifier.getAdapterFor(IStyleDeclarationAdapter.class);
    if (adapter == null)
        return null;
    if (!(adapter instanceof IStyleDeclarationAdapter))
        return null;
    IStyleDeclarationAdapter styleAdapter = (IStyleDeclarationAdapter) adapter;
    return styleAdapter.getModel();
}
Also used : IStyleDeclarationAdapter(org.eclipse.wst.css.core.internal.provisional.adapters.IStyleDeclarationAdapter) INodeAdapter(org.eclipse.wst.sse.core.internal.provisional.INodeAdapter) INodeNotifier(org.eclipse.wst.sse.core.internal.provisional.INodeNotifier)

Example 2 with IStyleDeclarationAdapter

use of org.eclipse.wst.css.core.internal.provisional.adapters.IStyleDeclarationAdapter in project webtools.sourceediting by eclipse.

the class HTMLElementFormatter method getCSSModel.

/**
 */
private ICSSModel getCSSModel(Attr attr) {
    if (attr == null)
        return null;
    INodeNotifier notifier = (INodeNotifier) attr.getOwnerElement();
    if (notifier == null)
        return null;
    INodeAdapter adapter = notifier.getAdapterFor(IStyleDeclarationAdapter.class);
    if (adapter == null)
        return null;
    if (!(adapter instanceof IStyleDeclarationAdapter))
        return null;
    IStyleDeclarationAdapter styleAdapter = (IStyleDeclarationAdapter) adapter;
    return styleAdapter.getModel();
}
Also used : IStyleDeclarationAdapter(org.eclipse.wst.css.core.internal.provisional.adapters.IStyleDeclarationAdapter) INodeAdapter(org.eclipse.wst.sse.core.internal.provisional.INodeAdapter) INodeNotifier(org.eclipse.wst.sse.core.internal.provisional.INodeNotifier)

Aggregations

IStyleDeclarationAdapter (org.eclipse.wst.css.core.internal.provisional.adapters.IStyleDeclarationAdapter)2 INodeAdapter (org.eclipse.wst.sse.core.internal.provisional.INodeAdapter)2 INodeNotifier (org.eclipse.wst.sse.core.internal.provisional.INodeNotifier)2