コード例 #1
0
ファイル: BaseXEditor.java プロジェクト: godmar/basex
 /**
  * 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);
 }
コード例 #2
0
ファイル: TextPanel.java プロジェクト: dimitarp/basex
 /**
  * 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 SyntaxXQuery()
           : file.hasSuffix(IO.JSONSUFFIX)
               ? new SyntaxJSON()
               : file.hasSuffix(IO.JSSUFFIX)
                   ? new SyntaxJS()
                   : file.hasSuffix(IO.XMLSUFFIXES)
                           || file.hasSuffix(IO.HTMLSUFFIXES)
                           || file.hasSuffix(IO.XSLSUFFIXES)
                           || file.hasSuffix(IO.BXSSUFFIX)
                       ? new SyntaxXML()
                       : Syntax.SIMPLE);
 }