use of org.eclipse.wst.css.core.internal.formatter.CSSSourceFormatter in project webtools.sourceediting by eclipse.
the class EmbeddedCSSFormatter method getCSSContent.
/**
*/
private String getCSSContent(IDOMNode text) {
ICSSModel model = getCSSModel(text);
if (model == null)
return null;
ICSSNode document = model.getDocument();
if (document == null)
return null;
INodeNotifier notifier = (INodeNotifier) document;
CSSSourceFormatter formatter = (CSSSourceFormatter) notifier.getAdapterFor(CSSSourceFormatter.class);
// try another way to get formatter
if (formatter == null)
formatter = CSSSourceFormatterFactory.getInstance().getSourceFormatter(notifier);
if (formatter == null)
return null;
StringBuffer buffer = formatter.format(document);
if (buffer == null)
return null;
return buffer.toString();
}
Aggregations