public SyntaxSupport createSyntaxSupport(BaseDocument doc) { return new ExtSyntaxSupport(doc); }
public Map getGlobalVariableMap(int offset) { Integer posI = new Integer(offset); Map varMap = (Map)globalVarMaps.get(posI); if (varMap == null) { varMap = buildGlobalVariableMap(offset); globalVarMaps.put(posI, varMap); } return varMap; }
public Map getLocalVariableMap(int offset) { Integer posI = new Integer(offset); Map varMap = (Map) localVarMaps.get(posI); if (varMap == null) { varMap = buildLocalVariableMap(offset); localVarMaps.put(posI, varMap); } return varMap; }
protected Map buildLocalVariableMap(int offset) { int methodStartPos = getMethodStartPosition(offset); if (methodStartPos >= 0 && methodStartPos < offset) { VariableMapTokenProcessor vmtp = createVariableMapTokenProcessor(methodStartPos, offset); try { tokenizeText(vmtp, methodStartPos, offset, true); return vmtp.getVariableMap(); } catch (BadLocationException e) { // will default null } } return null; }
private int findDeclarationPositionImpl(String varName, int startPos, int endPos) { DeclarationTokenProcessor dtp = createDeclarationTokenProcessor(varName, startPos, endPos); if (dtp != null) { try { tokenizeText(dtp, startPos, endPos, true); return dtp.getDeclarationPosition(); } catch (BadLocationException e) { // will default to -1 } } return -1; }
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; }
@Override protected int[] findNextSpellSpan(SyntaxSupport ts, int offset) throws BadLocationException { if (ts == null || hidden) return new int[] {-1, -1}; TokenItem item = null; int documentLength = ts.getDocument ().getLength (); if (offset < documentLength) item = ((ExtSyntaxSupport) ts).getTokenChain (offset, documentLength); while (item != null && item.getTokenID () != PropertiesTokenContext.VALUE) item = item.getNext (); if (item == null) return new int[] {-1, -1}; return new int[] {item.getOffset (), item.getOffset () + item.getImage ().length ()}; } }
public void removeUpdate(DocumentEvent evt) { documentModified(evt); }
public boolean gotoDeclaration(JTextComponent target) { try { Caret caret = target.getCaret(); int dotPos = caret.getDot(); BaseDocument doc = (BaseDocument) target.getDocument(); int[] idBlk = Utilities.getIdentifierBlock(doc, dotPos); ExtSyntaxSupport extSup = (ExtSyntaxSupport) doc.getSyntaxSupport(); if (idBlk != null) { int decPos = extSup.findDeclarationPosition(doc.getText(idBlk), idBlk[1]); if (decPos >= 0) { caret.setDot(decPos); return true; } } } catch (BadLocationException e) { } return false; }
if( !completion.isPaneVisible() ) { if (completion.isAutoPopupEnabled()) { int result = extSup.checkCompletion( target, typedText, false ); if ( result == ExtSyntaxSupport.COMPLETION_POPUP ) { completion.popup(true); int result = extSup.checkCompletion( target, typedText, true ); switch( result ) { case ExtSyntaxSupport.COMPLETION_HIDE:
return null; ExtSyntaxSupport sup = (ExtSyntaxSupport)bdoc.getSyntaxSupport(); TokenItem token = sup.getTokenChain(offset, offset+1); if (token == null || token.getTokenID().getNumericID() != JSFEditorUtilities.XML_TEXT) return null;
protected Map buildLocalVariableMap(int offset) { int methodStartPos = getMethodStartPosition(offset); if (methodStartPos >= 0 && methodStartPos < offset) { VariableMapTokenProcessor vmtp = createVariableMapTokenProcessor(methodStartPos, offset); try { tokenizeText(vmtp, methodStartPos, offset, 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; }
private int findDeclarationPositionImpl(String varName, int startPos, int endPos) { DeclarationTokenProcessor dtp = createDeclarationTokenProcessor(varName, startPos, endPos); if (dtp != null) { try { tokenizeText(dtp, startPos, endPos, true); return dtp.getDeclarationPosition(); } catch (BadLocationException e) { // will default to -1 } } return -1; }
public void insertUpdate(DocumentEvent evt) { documentModified(evt); }
public boolean gotoDeclaration(JTextComponent target) { try { Caret caret = target.getCaret(); int dotPos = caret.getDot(); BaseDocument doc = (BaseDocument)target.getDocument(); int[] idBlk = Utilities.getIdentifierBlock(doc, dotPos); ExtSyntaxSupport extSup = (ExtSyntaxSupport)doc.getSyntaxSupport(); if (idBlk != null) { int decPos = extSup.findDeclarationPosition(doc.getText(idBlk), idBlk[1]); if (decPos >= 0) { caret.setDot(decPos); return true; } } } catch (BadLocationException e) { } return false; }
if (!completion.isPaneVisible()) { if (completion.isAutoPopupEnabled()) { int result = extSup.checkCompletion(target, typedText, false); if (result == ExtSyntaxSupport.COMPLETION_POPUP) { completion.popup(true); int result = extSup.checkCompletion(target, typedText, true); switch (result) { case ExtSyntaxSupport.COMPLETION_HIDE:
token = sup.getTokenChain(offset, offset+1); if (token != null && token.getTokenID().getNumericID() == JSFEditorUtilities.XML_TEXT){ while (token!=null if(token != null && token.getImage().equals("<managed-bean")){ start = token.getOffset(); token = sup.getTokenChain(offset, offset+1); while (token != null && !(token.getTokenID().getNumericID() == JSFEditorUtilities.XML_ELEMENT
public SyntaxSupport createSyntaxSupport(BaseDocument doc) { return new ExtSyntaxSupport(doc); }
public void removeUpdate(DocumentEvent evt) { documentModified(evt); }