本文整理匯總了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;
}