コード例 #1
0
ファイル: ActionUtils.java プロジェクト: njwhite/jsyntaxpane
 /** Returns the the Token at pos as a String */
 public static String getTokenStringAt(SyntaxDocument doc, int pos) {
   String word = "";
   Token t = doc.getTokenAt(pos);
   if (t != null) {
     try {
       word = doc.getText(t.start, t.length);
     } catch (BadLocationException ex) {
       Logger.getLogger(ActionUtils.class.getName()).log(Level.SEVERE, null, ex);
     }
   }
   return word;
 }