| java.lang.Object org.netbeans.modules.php.editor.BracketCompletion
BracketCompletion | class BracketCompletion (Code) | | This static class groups the whole aspect of bracket completion. It is
defined to clearly separate the functionality and keep actions clean. The
methods of the class are called from different actions as KeyTyped,
DeletePreviousChar.
author: ads ( BraceCompletion from org.netbeans.modules.editor.java author: package is resued ). |
Method Summary | |
static void | addRightBrace(BaseDocument doc, Caret caret, int dotPos) | static void | charBackspaced(BaseDocument doc, int dotPos, Caret caret, char ch) Hook called after a character *ch* was backspace-deleted from *doc*. | static void | charInserted(BaseDocument doc, int dotPos, Caret caret, char ch) A hook method called after a character was inserted into the document. | static boolean | completeQuote(BaseDocument doc, int dotPos, Caret caret, char bracket) Check for conditions and possibly complete an already inserted quote . | static boolean | completionSettingEnabled() Returns true if bracket completion is enabled in options. | public static OffsetRange | findMatching(Document doc, int caretOffset) | static String | getEODStringLabel(BaseDocument doc, int dotPos) | static int | getRowOrBlockEnd(BaseDocument doc, int caretOffset) Returns position of the first unpaired closing paren/brace/bracket from
the caretOffset till the end of caret row. | static boolean | isAddRightBrace(BaseDocument doc, int caretOffset) Resolve whether pairing right curly should be added automatically at the
caret position or not. | static boolean | isNotClosedEOD(BaseDocument doc, int dotPos) | static boolean | isSkipClosingBracket(BaseDocument doc, int caretOffset, String bracketText, String leftBracketText) Check whether the typed bracket should stay in the document or be
removed. | static boolean | posWithinString(BaseDocument doc, int dotPos) | static boolean | useDotConnectorInStringSetting() |
charBackspaced | static void charBackspaced(BaseDocument doc, int dotPos, Caret caret, char ch) throws BadLocationException(Code) | | Hook called after a character *ch* was backspace-deleted from *doc*. The
function possibly removes bracket or quote pair if appropriate.
Parameters: doc - the document Parameters: dotPos - position of the change Parameters: caret - caret Parameters: ch - the character that was deleted |
charInserted | static void charInserted(BaseDocument doc, int dotPos, Caret caret, char ch) throws BadLocationException(Code) | | A hook method called after a character was inserted into the document.
The function checks for special characters for completion ()[]'"{} and
other conditions and optionally performs changes to the doc and or caret
(complets braces, moves caret, etc.)
Parameters: doc - the document where the change occurred Parameters: dotPos - position of the character insertion Parameters: caret - caret Parameters: ch - the character that was inserted throws: BadLocationException - if dotPos is not correct |
completeQuote | static boolean completeQuote(BaseDocument doc, int dotPos, Caret caret, char bracket) throws BadLocationException(Code) | | Check for conditions and possibly complete an already inserted quote .
Parameters: doc - the document Parameters: dotPos - position of the opening bracket (already in the doc) Parameters: caret - caret Parameters: bracket - the character that was inserted |
completionSettingEnabled | static boolean completionSettingEnabled()(Code) | | Returns true if bracket completion is enabled in options.
|
findMatching | public static OffsetRange findMatching(Document doc, int caretOffset)(Code) | | |
getEODStringLabel | static String getEODStringLabel(BaseDocument doc, int dotPos)(Code) | | |
getRowOrBlockEnd | static int getRowOrBlockEnd(BaseDocument doc, int caretOffset) throws BadLocationException(Code) | | Returns position of the first unpaired closing paren/brace/bracket from
the caretOffset till the end of caret row. If there is no such element,
position after the last non-white character on the caret row is returned.
|
isAddRightBrace | static boolean isAddRightBrace(BaseDocument doc, int caretOffset) throws BadLocationException(Code) | | Resolve whether pairing right curly should be added automatically at the
caret position or not.
There must be only whitespace or line comment or block comment between
the caret position and the left brace and the left brace must be on the
same line where the caret is located.
The caret must not be "contained" in the opened block comment token.
Parameters: doc - document in which to operate. Parameters: caretOffset - offset of the caret. true if a right brace '}' should be added or false if not. |
isNotClosedEOD | static boolean isNotClosedEOD(BaseDocument doc, int dotPos)(Code) | | returns true if there is ''
|
isSkipClosingBracket | static boolean isSkipClosingBracket(BaseDocument doc, int caretOffset, String bracketText, String leftBracketText) throws BadLocationException(Code) | | Check whether the typed bracket should stay in the document or be
removed.
This method is called by skipClosingBracket() .
Parameters: doc - document into which typing was done. Parameters: caretOffset - position of the caret in document Parameters: tokenText - inserted bracket token text Parameters: leftBracket - paired left bracket token text |
posWithinString | static boolean posWithinString(BaseDocument doc, int dotPos)(Code) | | returns true if php_string token is placed
on dotPos offset in doc document
|
useDotConnectorInStringSetting | static boolean useDotConnectorInStringSetting()(Code) | | Returns true if it is selected in Options
to add "\".\n\"" on line break
|
|
|