本文整理汇总了Java中com.intellij.codeInsight.lookup.impl.LookupImpl.isAvailableToUser方法的典型用法代码示例。如果您正苦于以下问题:Java LookupImpl.isAvailableToUser方法的具体用法?Java LookupImpl.isAvailableToUser怎么用?Java LookupImpl.isAvailableToUser使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.codeInsight.lookup.impl.LookupImpl
的用法示例。
在下文中一共展示了LookupImpl.isAvailableToUser方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: isEnabled
import com.intellij.codeInsight.lookup.impl.LookupImpl; //导入方法依赖的package包/类
@Override
public boolean isEnabled(Editor editor, DataContext dataContext) {
LookupImpl lookup = (LookupImpl)LookupManager.getActiveLookup(editor);
if (lookup == null) return false;
if (!lookup.isAvailableToUser()) return false;
if (focusedOnly && lookup.getFocusDegree() == LookupImpl.FocusDegree.UNFOCUSED) return false;
if (finishingChar == Lookup.NORMAL_SELECT_CHAR && hasTemplatePrefix(lookup, TemplateSettings.ENTER_CHAR) ||
finishingChar == Lookup.REPLACE_SELECT_CHAR && hasTemplatePrefix(lookup, TemplateSettings.TAB_CHAR)) {
return false;
}
if (finishingChar == Lookup.REPLACE_SELECT_CHAR) {
return !lookup.getItems().isEmpty();
}
return true;
}
示例2: isEnabled
import com.intellij.codeInsight.lookup.impl.LookupImpl; //导入方法依赖的package包/类
@Override
public boolean isEnabled(Editor editor, DataContext dataContext) {
LookupImpl lookup = (LookupImpl)LookupManager.getActiveLookup(editor);
if (lookup == null) return false;
if (!lookup.isAvailableToUser()) return false;
if (focusedOnly && lookup.getFocusDegree() == LookupImpl.FocusDegree.UNFOCUSED) return false;
if (finishingChar == Lookup.REPLACE_SELECT_CHAR) {
return !lookup.getItems().isEmpty();
}
return true;
}