public class InsightSupport
extends java.lang.Object
Constructor and Description |
---|
InsightSupport() |
Modifier and Type | Method and Description |
---|---|
void |
addToInsightTextField(java.lang.String text, javax.swing.text.JTextComponent textComponent)
Adds the given text to the given text component.
|
java.lang.String |
completeInsight(java.lang.Object insert, int insertIndx, javax.swing.text.Document doc, boolean matchCase)
Complete insight with given insert object.
|
static java.lang.String |
convertToString(java.lang.Object obj)
Static helper method for converting insight objects to a String
|
java.lang.Object[] |
filter(java.lang.Object[] filterObjects, java.lang.String filter, boolean applyContainsFilter)
Filter given objects by given filter value
|
static java.util.Comparator |
getComparator()
Gets a Comparator that generically compares objects.
|
java.lang.String |
getLastInserted()
Get last inserted value.
|
int |
getSelectionEndIndex()
Get selection end index.
|
int |
getSelectionStartIndex()
Get selection start index.
|
boolean |
isInQuotes(java.lang.String text)
Helper method to determine if given text is in quotes.
|
int[] |
lastNonAlphaNumIndex(java.lang.String text, int i)
Returns the last letter of digit in the given string before or at the given index.
|
int |
nextNonAlphaNumIndex(java.lang.String text, int i)
Returns the next index that contains a non letter or digit, or the end of the string if none are found.
|
boolean |
partOfName(char c)
Is the given character part of a name.
|
void |
setLastInserted(java.lang.String lastInserted)
Set last inserted insight value.
|
void |
setSelectionEndIndex(int selectionEndIndex)
Set selection end index.
|
void |
setSelectionStartIndex(int selectionStartIndex)
Set selection start index.
|
public java.lang.Object[] filter(java.lang.Object[] filterObjects, java.lang.String filter, boolean applyContainsFilter)
filterObjects
- objects to filterfilter
- filter valueapplyContainsFilter
- if true then include any objects that contain the filter value otherwise return objects that start with the filter valuepublic java.lang.String completeInsight(java.lang.Object insert, int insertIndx, javax.swing.text.Document doc, boolean matchCase) throws javax.swing.text.BadLocationException
insert
- object to insert into text documentinsertIndx
- point at which toisert insight objectdoc
- document of insight text componentmatchCase
- if true then match case of the word that is being auto-completed else just insert object without changing casejavax.swing.text.BadLocationException
- when exception occurspublic void addToInsightTextField(java.lang.String text, javax.swing.text.JTextComponent textComponent)
text
- text to addtextComponent
- text component to add topublic void setLastInserted(java.lang.String lastInserted)
lastInserted
- value that was last insertedpublic java.lang.String getLastInserted()
public void setSelectionStartIndex(int selectionStartIndex)
selectionStartIndex
- index for selection to beginpublic int getSelectionStartIndex()
public void setSelectionEndIndex(int selectionEndIndex)
selectionEndIndex
- index for selection to begin*public int getSelectionEndIndex()
public boolean isInQuotes(java.lang.String text)
text
- text to searchpublic boolean partOfName(char c)
c
- characterpublic int[] lastNonAlphaNumIndex(java.lang.String text, int i)
text
- the text to search ini
- the index to start searching BEFORE.public int nextNonAlphaNumIndex(java.lang.String text, int i)
text
- the text to search ini
- the index to start searching from.public static java.lang.String convertToString(java.lang.Object obj)
public static java.util.Comparator getComparator()