本文整理汇总了Java中com.intellij.codeInsight.editorActions.XmlAutoPopupHandler类的典型用法代码示例。如果您正苦于以下问题:Java XmlAutoPopupHandler类的具体用法?Java XmlAutoPopupHandler怎么用?Java XmlAutoPopupHandler使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
XmlAutoPopupHandler类属于com.intellij.codeInsight.editorActions包,在下文中一共展示了XmlAutoPopupHandler类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: acceptChar
import com.intellij.codeInsight.editorActions.XmlAutoPopupHandler; //导入依赖的package包/类
@Override
public Result acceptChar(char c, final int prefixLength, final Lookup lookup) {
if (!isInXmlContext(lookup)) return null;
if (Character.isJavaIdentifierPart(c)) return Result.ADD_TO_PREFIX;
switch(c){
case '-':
case ':':
return Result.ADD_TO_PREFIX;
case '/':
if (isWithinTag(lookup)) {
if (prefixLength > 0) {
return Result.SELECT_ITEM_AND_FINISH_LOOKUP;
}
XmlAutoPopupHandler.autoPopupXmlLookup(lookup.getEditor().getProject(), lookup.getEditor());
return Result.HIDE_LOOKUP;
}
return Result.ADD_TO_PREFIX;
case '>': if (prefixLength > 0) {
return Result.SELECT_ITEM_AND_FINISH_LOOKUP;
}
case '\'':
case '\"':
return Result.SELECT_ITEM_AND_FINISH_LOOKUP;
default:
return null;
}
}
示例2: acceptChar
import com.intellij.codeInsight.editorActions.XmlAutoPopupHandler; //导入依赖的package包/类
public Result acceptChar(char c, final int prefixLength, final Lookup lookup) {
if (!isInXmlContext(lookup)) return null;
if (Character.isJavaIdentifierPart(c)) return Result.ADD_TO_PREFIX;
switch(c){
case '-':
case ':':
return Result.ADD_TO_PREFIX;
case '/':
if (isWithinTag(lookup)) {
if (prefixLength > 0) {
return Result.SELECT_ITEM_AND_FINISH_LOOKUP;
}
XmlAutoPopupHandler.autoPopupXmlLookup(lookup.getEditor().getProject(), lookup.getEditor());
return Result.HIDE_LOOKUP;
}
return Result.ADD_TO_PREFIX;
case '>': if (prefixLength > 0) {
return Result.SELECT_ITEM_AND_FINISH_LOOKUP;
}
case '\'':
case '\"':
return Result.SELECT_ITEM_AND_FINISH_LOOKUP;
default:
return null;
}
}
示例3: acceptChar
import com.intellij.codeInsight.editorActions.XmlAutoPopupHandler; //导入依赖的package包/类
@Override
public Result acceptChar(char c, final int prefixLength, final Lookup lookup)
{
if(!isInXmlContext(lookup))
{
return null;
}
if(Character.isJavaIdentifierPart(c))
{
return Result.ADD_TO_PREFIX;
}
switch(c)
{
case '-':
case ':':
case '?':
return Result.ADD_TO_PREFIX;
case '/':
if(isWithinTag(lookup))
{
if(prefixLength > 0)
{
return Result.SELECT_ITEM_AND_FINISH_LOOKUP;
}
XmlAutoPopupHandler.autoPopupXmlLookup(lookup.getProject(), lookup.getEditor());
return Result.HIDE_LOOKUP;
}
return Result.ADD_TO_PREFIX;
case '>':
if(prefixLength > 0)
{
return Result.SELECT_ITEM_AND_FINISH_LOOKUP;
}
case '\'':
case '\"':
return Result.SELECT_ITEM_AND_FINISH_LOOKUP;
default:
return null;
}
}