Package org.cfeclipse.cfml.editors

Examples of org.cfeclipse.cfml.editors.SQLSyntaxDictionary


    //I think the reason this doesnt work as well as the <!-- type of comment
    //is that the <! type is defined on the partition scanner where this is
    //only here... javascript has the same problem
    rules.add(new MultiLineRule("/*", "*/", sqlcomment));
   
    SQLSyntaxDictionary dic = (SQLSyntaxDictionary)DictionaryManager.getDictionary(DictionaryManager.SQLDIC);
     

    //get any SQL specific keywords (select, from, where, et cetra)   
   
    Set set = dic.getSQLKeywords();
   
    String allkeys[] = new String[set.size()];
    int i=0;
    Iterator it = set.iterator();
    while(it.hasNext())
    {
      String keywd = (String)it.next();
      allkeys[i++] = keywd;
    }

   
    //build the word highlighter
    SQLKeywordDetector cfqkd = new SQLKeywordDetector();
    PredicateWordRule words = new PredicateWordRule(
      cfqkd,
      cfquerytext,
      allkeys,
      sqlkeyword
    );
   
    words.setCaseSensitive(false);
   
    //now do the cffunctions so they look pretty too :)
    set = dic.getFunctions();
    it = set.iterator();
    while(it.hasNext())
    {
      String fun = (String)it.next();
      words.addWord(fun, cffunction);
View Full Code Here


    if(dictionaryVersionCache.containsKey(versionkey)){
      return (SyntaxDictionary)dictionaryVersionCache.get(versionkey);
    }
    else{
    SAXBuilder builder = new SAXBuilder();
    SyntaxDictionary dic = new SQLSyntaxDictionary();
    URL dictionaryConfigURL = null;
   
      try {
        dictionaryConfigURL = new URL(
          CFMLPlugin.getDefault().getBundle().getEntry("/"),
          "dictionary/"
        );
        URL configurl = FileLocator.LocateURL(dictionaryConfigURL, "dictionaryconfig.xml");
        org.jdom.Document document = builder.build(configurl);
       
        XPath x  = XPath.newInstance("//dictionary[@id='CF_DICTIONARY']/version[@key=\'"+ versionkey +"\']/grammar[1]");
       
        Element grammerElement    = (Element)x.selectSingleNode(document);
        dic = new SQLSyntaxDictionary();
        ((CFSyntaxDictionary)dic).loadDictionary(grammerElement.getAttributeValue("location"));
        dictionaryVersionCache.put(versionkey, dic);
      } catch (MalformedURLException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
View Full Code Here

    SyntaxDictionary dic = null;
   
    if(dicttype.equals(CFDIC))
    {
      //load the cfml into the cache
      dic = new SQLSyntaxDictionary();
      //TODO: make this not a hack
      String sqlwords = dictionaryConfig.getElementById(SQLDIC).getFirstChild().getFirstChild().getAttributes().getNamedItem("location").getNodeValue();
      ((SQLSyntaxDictionary)dic).loadKeywords(sqlwords);
    }
    else if(dicttype.equals(JSDIC))
View Full Code Here

TOP

Related Classes of org.cfeclipse.cfml.editors.SQLSyntaxDictionary

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.