return template.matches(getKey(), getContextType().getName());
}
+ /**
+ * Returns <code>true</code> if template matches the prefix and context,
+ * <code>false</code> otherwise.
+ */
+ public boolean canEvaluate(String identifier) {
+ String prefix = getKey();
+ return
+// fEnabled &&
+// fContextTypeName.equals(contextTypeName) &&
+ (prefix.length() != 0) &&
+ identifier.toLowerCase().startsWith(prefix.toLowerCase());
+ }
+
/*
* @see TemplateContext#evaluate(Template template)
*/
try {
int start= getCompletionPosition();
- while ((start != 0) && Character.isUnicodeIdentifierPart(document.getChar(start - 1)))
+ while ( ((start != 0) && Character.isUnicodeIdentifierPart(document.getChar(start - 1))) ||
+ ((start != 0) && document.getChar(start - 1)=='$') ) {
start--;
+ }
- if ((start != 0) && Character.isUnicodeIdentifierStart(document.getChar(start - 1)))
+ if ( ((start != 0) && Character.isUnicodeIdentifierStart(document.getChar(start - 1))) ||
+ ((start != 0) && document.getChar(start - 1)=='$')) {
start--;
+ }
return start;