Java Code Examples for org.netbeans.editor.Utilities#annotateLoggable()

The following examples show how to use org.netbeans.editor.Utilities#annotateLoggable() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: JavaLayerTokenContext.java    From netbeans with Apache License 2.0 5 votes vote down vote up
private JavaLayerTokenContext() {
    super("java-layer-"); // NOI18N

    try {
        addDeclaredTokenIDs();
    } catch (Exception e) {
        Utilities.annotateLoggable(e);
    }

}
 
Example 2
Source File: JavaTokenContext.java    From netbeans with Apache License 2.0 5 votes vote down vote up
private JavaTokenContext() {
    super("java-"); // NOI18N

    try {
        addDeclaredTokenIDs();
    } catch (Exception e) {
        Utilities.annotateLoggable(e);
    }

}
 
Example 3
Source File: HtmlTokenContext.java    From netbeans with Apache License 2.0 5 votes vote down vote up
private HtmlTokenContext() {
    super("html-"); // NOI18N

    try {
        addDeclaredTokenIDs();
    } catch (Exception e) {
        Utilities.annotateLoggable(e);
    }

}
 
Example 4
Source File: MarkChain.java    From netbeans with Apache License 2.0 5 votes vote down vote up
protected ChainDrawMark createAndInsertNewMark(int pos)
throws BadLocationException {
    ChainDrawMark mark = createMark();
    try {
        EditorPackageAccessor.get().Mark_insert(mark, doc, pos);
    } catch (InvalidMarkException e) {
        Utilities.annotateLoggable(e);
    }
    return mark;
}
 
Example 5
Source File: PlainTokenContext.java    From netbeans with Apache License 2.0 5 votes vote down vote up
private PlainTokenContext() {
    super("format-"); // NOI18N

    try {
        addDeclaredTokenIDs();
    } catch (Exception e) {
        Utilities.annotateLoggable(e);
    }

}
 
Example 6
Source File: MarkChain.java    From netbeans with Apache License 2.0 4 votes vote down vote up
/** Tests whether the position range is partly or fully inside
* some mark block from the chain.
* @param pos compared position
* @return relation of curMark to the given position
*/
public int compareMark(int pos) {
    try {
        if (curMark == null) {
            curMark = chain;
            if (curMark == null) {
                return -1; // no marks yet
            }
        }

        int rel;
        boolean after = false;
        boolean before = false;
        while ((rel = curMark.compare(pos)) != 0) { // just match
            if (rel > 0) { // this mark after pos
                if (before) {
                    return rel;
                }
                if (curMark.prev != null) {
                    after = true;
                    curMark = curMark.prev;
                } else { // end of chain
                    return rel;
                }
            } else { // this mark before pos
                if (after) {
                    return rel;
                }
                if (curMark.next != null) {
                    before = true;
                    curMark = curMark.next;
                } else { // start of chain
                    return rel;
                }
            }
        }
        return 0; // match
    } catch (InvalidMarkException e) {
        Utilities.annotateLoggable(e);
        return -1; // don't match, but what to return?
    }
}