use of org.eclipse.wst.css.core.internal.provisional.adapters.IStyleSheetAdapter in project webtools.sourceediting by eclipse.
the class CSSTextNodeCleanupHandler method getCSSModel.
/**
*/
private ICSSModel getCSSModel(Node text) {
if (text == null)
return null;
INodeNotifier notifier = (INodeNotifier) text.getParentNode();
if (notifier == null)
return null;
INodeAdapter adapter = notifier.getAdapterFor(IStyleSheetAdapter.class);
if (adapter == null)
return null;
if (!(adapter instanceof IStyleSheetAdapter))
return null;
IStyleSheetAdapter styleAdapter = (IStyleSheetAdapter) adapter;
return styleAdapter.getModel();
}
use of org.eclipse.wst.css.core.internal.provisional.adapters.IStyleSheetAdapter in project webtools.sourceediting by eclipse.
the class CSSStyleSheetImpl method getOwnerNodes.
/**
* @return org.w3c.dom.NodeList
*/
public org.w3c.dom.NodeList getOwnerNodes() {
List list = (getModel().getStyleListeners() != null) ? new Vector(getModel().getStyleListeners()) : null;
if (list == null)
return null;
InternalNodeList nodes = new InternalNodeList();
Iterator it = list.iterator();
while (it.hasNext()) {
Object obj = it.next();
if (obj instanceof IStyleSheetAdapter) {
nodes.nodes.add(((IStyleSheetAdapter) obj).getElement());
}
}
if (nodes.getLength() > 0)
return nodes;
else
return null;
}
use of org.eclipse.wst.css.core.internal.provisional.adapters.IStyleSheetAdapter in project webtools.sourceediting by eclipse.
the class HTMLDocumentAdapter method removeOldStyleSheets.
/**
*/
private void removeOldStyleSheets() {
if (this.oldStyleAdapters == null)
return;
Iterator it = this.oldStyleAdapters.iterator();
while (it.hasNext()) {
IStyleSheetAdapter adapter = (IStyleSheetAdapter) it.next();
if (adapter == null)
continue;
// do not release
if (this.styleAdapters != null && this.styleAdapters.contains(adapter))
continue;
adapter.removed();
}
this.oldStyleAdapters = null;
}
use of org.eclipse.wst.css.core.internal.provisional.adapters.IStyleSheetAdapter in project webtools.sourceediting by eclipse.
the class EmbeddedCSSFormatter method getCSSModel.
/**
*/
private ICSSModel getCSSModel(IDOMNode text) {
if (text == null)
return null;
INodeNotifier notifier = (INodeNotifier) text.getParentNode();
if (notifier == null)
return null;
INodeAdapter adapter = notifier.getAdapterFor(IStyleSheetAdapter.class);
if (adapter == null)
return null;
if (!(adapter instanceof IStyleSheetAdapter))
return null;
IStyleSheetAdapter styleAdapter = (IStyleSheetAdapter) adapter;
return styleAdapter.getModel();
}
Aggregations