Examples of BaseDocument


Examples of org.netbeans.editor.BaseDocument

      return AbstractHint.getDescription(name);
    }

    @Override
    public ChangeInfo implement() throws Exception {
      final BaseDocument bdoc = (BaseDocument) doc;
      bdoc.runAtomic(new Runnable() {
        @Override
        public void run() {
          try {
            bdoc.remove(start, "assign".length());
            bdoc.insertString(start, "var", null);
          } catch(BadLocationException ex) {
            Exceptions.printStackTrace(ex);
          }
        }
      });
View Full Code Here

Examples of org.netbeans.editor.BaseDocument

    public ChangeInfo implement() throws Exception {
      String text = doc.getText(start, length);
      //fixme
      final String replaced = text.replaceAll("(\\$?[a-zA-Z0-9_]+ *=)(\\>)", "$1");
     
      final BaseDocument bdoc = (BaseDocument) doc;
      bdoc.runAtomic(new Runnable() {
        @Override
        public void run() {
          try {
            bdoc.remove(start, length);
            bdoc.insertString(start, replaced, null);
          } catch(BadLocationException ex) {
            Exceptions.printStackTrace(ex);
          }
        }
      });
View Full Code Here

Examples of org.netbeans.editor.BaseDocument

    @Override
    public ChangeInfo implement() throws Exception {
      String text = doc.getText(start, length);

      final BaseDocument bdoc = (BaseDocument) doc;
      bdoc.runAtomic(new Runnable() {
        @Override
        public void run() {
          try {
            bdoc.insertString(start, "[", null);
            bdoc.remove(start+1, 6);
            bdoc.remove(start+length-5, 1);
            bdoc.insertString(start+length-5, "]", null);
          } catch(BadLocationException ex) {
            Exceptions.printStackTrace(ex);
          }
        }
      });
View Full Code Here

Examples of org.netbeans.editor.BaseDocument

    }

    @Override
    public TokenList findTokenList(Document doc) {
        if (doc instanceof BaseDocument) {
            BaseDocument baseDoc = (BaseDocument) doc;
            final Object mimeType = baseDoc.getProperty("mimeType");
            if (MarkdownLanguageConfig.MIME_TYPE.equals(mimeType)) {
                return new MarkdownTokenList(doc);
            }
        }
        return null;
View Full Code Here

Examples of org.netbeans.editor.BaseDocument

     * returns a String array with all the annotations on the current line
     *
     * @return
     */
    private String[][] getAnnotation(){
        BaseDocument document = (BaseDocument)text.getDocument();
        int lineNumber = getCurrentLineNumber() - 1;
       
        if (document != null && lineNumber != -1) {
            //get a list if all annotations in the document
            Annotations docAnnotations = document.getAnnotations();
            int count = docAnnotations.getNumberOfAnnotations(lineNumber);
            if (count == 0) {
                return null;
            }
            else {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.