Search in sources :

Example 1 with ApplyIntentionAction

use of com.intellij.ide.actions.ApplyIntentionAction in project intellij-community by JetBrains.

the class GotoActionItemProvider method processIntentions.

private boolean processIntentions(String pattern, Processor<MatchedValue> consumer, DataContext dataContext) {
    MinusculeMatcher matcher = NameUtil.buildMatcher("*" + pattern, NameUtil.MatchingCaseSensitivity.NONE);
    Map<String, ApplyIntentionAction> intentionMap = myIntentions.getValue();
    JBIterable<ActionWrapper> intentions = JBIterable.from(intentionMap.keySet()).transform(intentionText -> {
        ApplyIntentionAction intentionAction = intentionMap.get(intentionText);
        if (myModel.actionMatches(pattern, matcher, intentionAction) == MatchMode.NONE)
            return null;
        return new ActionWrapper(intentionAction, intentionText, MatchMode.INTENTION, dataContext);
    }).filter(Condition.NOT_NULL);
    return processItems(pattern, intentions, consumer);
}
Also used : CollectConsumer(com.intellij.util.CollectConsumer) java.util(java.util) JBIterable(com.intellij.util.containers.JBIterable) ApplyIntentionAction(com.intellij.ide.actions.ApplyIntentionAction) MinusculeMatcher(com.intellij.psi.codeStyle.MinusculeMatcher) ContainerUtil(com.intellij.util.containers.ContainerUtil) ActionFromOptionDescriptorProvider(com.intellij.ide.ui.search.ActionFromOptionDescriptorProvider) NameUtil(com.intellij.psi.codeStyle.NameUtil) SearchableOptionsRegistrarImpl(com.intellij.ide.ui.search.SearchableOptionsRegistrarImpl) Project(com.intellij.openapi.project.Project) SearchableOptionsRegistrar(com.intellij.ide.ui.search.SearchableOptionsRegistrar) Matcher(com.intellij.util.text.Matcher) DataManager(com.intellij.ide.DataManager) ProgressManager(com.intellij.openapi.progress.ProgressManager) StringUtil(com.intellij.openapi.util.text.StringUtil) NotNullLazyValue(com.intellij.openapi.util.NotNullLazyValue) ActionManagerImpl(com.intellij.openapi.actionSystem.impl.ActionManagerImpl) com.intellij.openapi.actionSystem(com.intellij.openapi.actionSystem) Nullable(org.jetbrains.annotations.Nullable) ProgressIndicator(com.intellij.openapi.progress.ProgressIndicator) GotoActionModel(com.intellij.ide.util.gotoByName.GotoActionModel) OptionDescription(com.intellij.ide.ui.search.OptionDescription) Processor(com.intellij.util.Processor) OptionsTopHitProvider(com.intellij.ide.ui.OptionsTopHitProvider) NotNull(org.jetbrains.annotations.NotNull) SearchTopHitProvider(com.intellij.ide.SearchTopHitProvider) Condition(com.intellij.openapi.util.Condition) ApplyIntentionAction(com.intellij.ide.actions.ApplyIntentionAction) MinusculeMatcher(com.intellij.psi.codeStyle.MinusculeMatcher)

Aggregations

DataManager (com.intellij.ide.DataManager)1 SearchTopHitProvider (com.intellij.ide.SearchTopHitProvider)1 ApplyIntentionAction (com.intellij.ide.actions.ApplyIntentionAction)1 OptionsTopHitProvider (com.intellij.ide.ui.OptionsTopHitProvider)1 ActionFromOptionDescriptorProvider (com.intellij.ide.ui.search.ActionFromOptionDescriptorProvider)1 OptionDescription (com.intellij.ide.ui.search.OptionDescription)1 SearchableOptionsRegistrar (com.intellij.ide.ui.search.SearchableOptionsRegistrar)1 SearchableOptionsRegistrarImpl (com.intellij.ide.ui.search.SearchableOptionsRegistrarImpl)1 GotoActionModel (com.intellij.ide.util.gotoByName.GotoActionModel)1 com.intellij.openapi.actionSystem (com.intellij.openapi.actionSystem)1 ActionManagerImpl (com.intellij.openapi.actionSystem.impl.ActionManagerImpl)1 ProgressIndicator (com.intellij.openapi.progress.ProgressIndicator)1 ProgressManager (com.intellij.openapi.progress.ProgressManager)1 Project (com.intellij.openapi.project.Project)1 Condition (com.intellij.openapi.util.Condition)1 NotNullLazyValue (com.intellij.openapi.util.NotNullLazyValue)1 StringUtil (com.intellij.openapi.util.text.StringUtil)1 MinusculeMatcher (com.intellij.psi.codeStyle.MinusculeMatcher)1 NameUtil (com.intellij.psi.codeStyle.NameUtil)1 CollectConsumer (com.intellij.util.CollectConsumer)1