/** * Sets a syntax highlighter, based on the file format. * * @param file file reference * @param opened indicates if file was opened from disk */ protected final void setSyntax(final IO file, final boolean opened) { setSyntax( !opened || file.hasSuffix(IO.XQSUFFIXES) ? new XQuerySyntax() : file.hasSuffix(IO.JSONSUFFIX) ? new JSONSyntax() : file.hasSuffix(IO.XMLSUFFIXES) || file.hasSuffix(IO.HTMLSUFFIXES) ? new XMLSyntax() : BaseXSyntax.SIMPLE); }