/** Does the line contain some valid code besides of possible white space * and comments? */ public boolean isRowValid(int offset) throws BadLocationException { return Utilities.isRowWhite(getDocument(), offset); }
/** * Does the line contain some valid code besides of possible white space and * comments? */ public boolean isRowValid(int offset) throws BadLocationException { return Utilities.isRowWhite(getDocument(), offset); }
/** Gets the last non-blank and non-comment character on the given line. */ public int getRowLastValidChar(int offset) throws BadLocationException { return Utilities.getRowLastNonWhite(getDocument(), offset); }
protected void finalize() throws Throwable { if (docL != null) { getDocument().removeDocumentListener(docL); docL = null; } super.finalize(); }
/** * Gets the last non-blank and non-comment character on the given line. */ public int getRowLastValidChar(int offset) throws BadLocationException { return Utilities.getRowLastNonWhite(getDocument(), offset); }
protected void finalize() throws Throwable { if (docL != null) { getDocument().removeDocumentListener(docL); docL = null; } super.finalize(); }
public int eot(int offset) { return ((Integer) getDocument().getProperty(SettingsNames.MARK_DISTANCE)).intValue(); }
public int eot(int offset) { return ((Integer)getDocument().getProperty(SettingsNames.MARK_DISTANCE)).intValue(); }
public ExtSyntaxSupport(BaseDocument doc) { super(doc); // Create listener to listen on document changes docL = new DocumentListener() { public void insertUpdate(DocumentEvent evt) { documentModified(evt); } public void removeUpdate(DocumentEvent evt) { documentModified(evt); } public void changedUpdate(DocumentEvent evt) { } }; getDocument().addDocumentListener(docL); }
public ExtSyntaxSupport(BaseDocument doc) { super(doc); // Create listener to listen on document changes docL = new DocumentListener() { public void insertUpdate(DocumentEvent evt) { documentModified(evt); } public void removeUpdate(DocumentEvent evt) { documentModified(evt); } public void changedUpdate(DocumentEvent evt) { } }; getDocument().addDocumentListener(docL); }
/** * Get the position of the global declaration of a given variable. By * default it's implemented to use the same token processor as for the local * variables but the whole file is searched. */ public int findGlobalDeclarationPosition(String varName, int varPos) { return findDeclarationPositionImpl(varName, 0, getDocument().getLength()); }
/** Get the position of the global declaration of a given variable. * By default it's implemented to use the same token processor as for the local * variables but the whole file is searched. */ public int findGlobalDeclarationPosition(String varName, int varPos) { return findDeclarationPositionImpl(varName, 0, getDocument().getLength()); }
public int[] getFunctionBlock(int offset) throws BadLocationException { return getFunctionBlock(Utilities.getIdentifierBlock(getDocument(), offset)); }
public int[] getFunctionBlock(int offset) throws BadLocationException { return getFunctionBlock(Utilities.getIdentifierBlock(getDocument(), offset)); }
public void insertUpdate(DocumentEvent evt) { if (lastItem != null && evt.getOffset() < lastItem.getOffset() + lastItem.getImage().length()) { docModified = true; getDocument().removeDocumentListener(this); docL = null; } }
public void removeUpdate(DocumentEvent evt) { if (lastItem != null && evt.getOffset() < lastItem.getOffset() + lastItem.getImage().length()) { docModified = true; getDocument().removeDocumentListener(this); docL = null; } }
/** Gets the token-id of the token at the given position. * @param offset position at which the token should be returned * @return token-id of the token at the requested position. If there's no more * tokens in the text, the <tt>Syntax.INVALID</tt> is returned. */ public TokenID getTokenID(int offset) throws BadLocationException { FirstTokenTP fttp = new FirstTokenTP(); tokenizeText(fttp, offset, getDocument().getLength(), true); return fttp.getTokenID(); }
/** * Gets the token-id of the token at the given position. * * @param offset * position at which the token should be returned * @return token-id of the token at the requested position. If there's no * more tokens in the text, the <tt>Syntax.INVALID</tt> is * returned. */ public TokenID getTokenID(int offset) throws BadLocationException { FirstTokenTP fttp = new FirstTokenTP(); tokenizeText(fttp, offset, getDocument().getLength(), true); return fttp.getTokenID(); }
protected Map buildGlobalVariableMap(int offset) { int docLen = getDocument().getLength(); VariableMapTokenProcessor vmtp = createVariableMapTokenProcessor(0, docLen); if (vmtp != null) { try { tokenizeText(vmtp, 0, docLen, true); return vmtp.getVariableMap(); } catch (BadLocationException e) { // will default null } } return null; }
protected Map buildGlobalVariableMap(int offset) { int docLen = getDocument().getLength(); VariableMapTokenProcessor vmtp = createVariableMapTokenProcessor(0, docLen); if (vmtp != null) { try { tokenizeText(vmtp, 0, docLen, true); return vmtp.getVariableMap(); } catch (BadLocationException e) { // will default null } } return null; }