本文整理汇总了Java中com.intellij.codeInsight.lookup.LookupElement.getAllLookupStrings方法的典型用法代码示例。如果您正苦于以下问题:Java LookupElement.getAllLookupStrings方法的具体用法?Java LookupElement.getAllLookupStrings怎么用?Java LookupElement.getAllLookupStrings使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.codeInsight.lookup.LookupElement
的用法示例。
在下文中一共展示了LookupElement.getAllLookupStrings方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: completeTillTypedCharOccurrence
import com.intellij.codeInsight.lookup.LookupElement; //导入方法依赖的package包/类
private static boolean completeTillTypedCharOccurrence(char charTyped, LookupImpl lookup, LookupElement item) {
PrefixMatcher matcher = lookup.itemMatcher(item);
final String oldPrefix = matcher.getPrefix() + lookup.getAdditionalPrefix();
PrefixMatcher expanded = matcher.cloneWithPrefix(oldPrefix + charTyped);
if (expanded.prefixMatches(item)) {
for (String s : item.getAllLookupStrings()) {
if (matcher.prefixMatches(s)) {
int i = -1;
while (true) {
i = s.indexOf(charTyped, i + 1);
if (i < 0) break;
final String newPrefix = s.substring(0, i + 1);
if (expanded.prefixMatches(newPrefix)) {
lookup.replacePrefix(oldPrefix, newPrefix);
return true;
}
}
}
}
}
return false;
}
示例2: getLookupAction
import com.intellij.codeInsight.lookup.LookupElement; //导入方法依赖的package包/类
static CharFilter.Result getLookupAction(final char charTyped, final LookupImpl lookup) {
final CharFilter.Result filtersDecision = getFiltersDecision(charTyped, lookup);
final LookupElement currentItem = lookup.getCurrentItem();
if (currentItem != null && charTyped != ' ') {
String postfix = lookup.getAdditionalPrefix() + charTyped;
final PrefixMatcher matcher = lookup.itemMatcher(currentItem);
for (String lookupString : currentItem.getAllLookupStrings()) {
if (lookupString.startsWith(matcher.getPrefix() + postfix)) {
return CharFilter.Result.ADD_TO_PREFIX;
}
}
}
if (filtersDecision != null) {
return filtersDecision;
}
throw new AssertionError("Typed char not handler by char filter: c=" + charTyped +
"; prefix=" + currentItem +
"; filters=" + Arrays.toString(getFilters()));
}
示例3: customizeLayoutAttributeLookupElement
import com.intellij.codeInsight.lookup.LookupElement; //导入方法依赖的package包/类
private static CompletionResult customizeLayoutAttributeLookupElement(String localName,
LookupElement lookupElement,
CompletionResult result) {
final String layoutPrefix = "layout_";
if (!localName.startsWith(layoutPrefix)) {
return result;
}
final String localSuffix = localName.substring(layoutPrefix.length());
if (localSuffix.length() > 0) {
final HashSet<String> lookupStrings = new HashSet<String>(lookupElement.getAllLookupStrings());
lookupStrings.add(localSuffix);
lookupElement = new LookupElementDecorator<LookupElement>(lookupElement) {
@Override
public Set<String> getAllLookupStrings() {
return lookupStrings;
}
};
}
return result.withLookupElement(PrioritizedLookupElement.withPriority(lookupElement, 100.0));
}
示例4: prefixMatches
import com.intellij.codeInsight.lookup.LookupElement; //导入方法依赖的package包/类
public boolean prefixMatches(@NotNull LookupElement element) {
for (String s : element.getAllLookupStrings()) {
if (prefixMatches(s)) {
return true;
}
}
return false;
}
示例5: isStartMatch
import com.intellij.codeInsight.lookup.LookupElement; //导入方法依赖的package包/类
public boolean isStartMatch(LookupElement element) {
for (String s : element.getAllLookupStrings()) {
if (isStartMatch(s)) {
return true;
}
}
return false;
}
示例6: getBestMatchingDegree
import com.intellij.codeInsight.lookup.LookupElement; //导入方法依赖的package包/类
public static int getBestMatchingDegree(LookupElement element, PrefixMatcher matcher) {
int max = Integer.MIN_VALUE;
for (String lookupString : element.getAllLookupStrings()) {
max = Math.max(max, matcher.matchingDegree(lookupString));
}
return -max;
}
示例7: prefixMatchersInternal
import com.intellij.codeInsight.lookup.LookupElement; //导入方法依赖的package包/类
private boolean prefixMatchersInternal(final LookupElement element, final boolean itemCaseInsensitive) {
for (final String name : element.getAllLookupStrings()) {
if (itemCaseInsensitive && StringUtil.startsWithIgnoreCase(name, myPrefix) || prefixMatches(name)) {
return true;
}
if (itemCaseInsensitive && CodeInsightSettings.ALL != CodeInsightSettings.getInstance().COMPLETION_CASE_SENSITIVE) {
if (myCaseInsensitiveMatcher.matches(name)) {
return true;
}
}
}
return false;
}