return fInstance;
}
public IStructuredFormatter createFormatter(Node node,
IStructuredFormatPreferences formatPreferences) {
IStructuredFormatter formatter = null;
switch (node.getNodeType()) {
case Node.ELEMENT_NODE:
if (node instanceof ElementImplForPhp
&& ((ElementImplForPhp) node).isPhpTag()) {
formatter = new PhpFormatter(start, length);
} else {
formatter = new HTMLElementFormatterNoPHP();
}
break;
case Node.TEXT_NODE:
if (isEmbeddedCSS(node)) {
formatter = new EmbeddedCSSFormatterNoPHP();
} else {
formatter = new HTMLTextFormatterNoPHP();
}
break;
default:
formatter = new HTMLFormatterNoPHP();
break;
}
// init FormatPreferences
formatter.setFormatPreferences(formatPreferences);
return formatter;
}