usage view: move "import to favorites" from groups/filters toolbar

This commit is contained in:
anna
2012-07-12 11:55:27 +02:00
parent 801a923a4d
commit 1a548e2910
4 changed files with 816 additions and 856 deletions
@@ -1,45 +0,0 @@
/*
* Copyright 2000-2012 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.intellij.ide.favoritesTreeView;
import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.project.Project;
import com.intellij.usages.UsageView;
import com.intellij.usages.rules.UsageGroupingRule;
import com.intellij.usages.rules.UsageGroupingRuleProvider;
import org.jetbrains.annotations.NotNull;
/**
* Created with IntelliJ IDEA.
* User: Irina.Chernushina
* Date: 6/2/12
* Time: 5:01 PM
*/
public class WorkingSetUsageActionProvider implements UsageGroupingRuleProvider {
private UsageGroupingRule[] myRules = new UsageGroupingRule[0];
@NotNull
@Override
public UsageGroupingRule[] getActiveRules(Project project) {
return myRules;
}
@NotNull
@Override
public AnAction[] createGroupingActions(UsageView view) {
return new AnAction[]{new ImportUsagesAction()};
}
}
@@ -515,7 +515,6 @@
<usageFilteringRuleProvider implementation="com.intellij.usages.impl.UsageFilteringRuleProviderImpl"/>
<usageGroupingRuleProvider implementation="com.intellij.usages.impl.UsageGroupingRuleProviderImpl"/>
<usageGroupingRuleProvider implementation="com.intellij.ide.favoritesTreeView.WorkingSetUsageActionProvider"/>
<projectService serviceInterface="com.intellij.psi.templateLanguages.TemplateDataLanguageMappings"
serviceImplementation="com.intellij.psi.templateLanguages.TemplateDataLanguageMappings"/>
File diff suppressed because it is too large Load Diff
@@ -478,6 +478,7 @@ public class UsageViewImpl implements UsageView, UsageModelTracker.UsageModelTra
actionsManager.createPrevOccurenceAction(myRootPanel),
actionsManager.createNextOccurenceAction(myRootPanel),
actionsManager.installAutoscrollToSourceHandler(myProject, myTree, new MyAutoScrollToSourceOptionProvider()),
createImportToFavorites(),
actionsManager.createExportToTextFileAction(myTextFileExporter),
actionsManager.createHelpAction(HELP_ID)
};
@@ -489,6 +490,10 @@ public class UsageViewImpl implements UsageView, UsageModelTracker.UsageModelTra
return action;
}
private static AnAction createImportToFavorites() {
return ActionManager.getInstance().getAction("UsageView.ImportToFavorites");
}
private AnAction[] createGroupingActions() {
final UsageGroupingRuleProvider[] providers = Extensions.getExtensions(UsageGroupingRuleProvider.EP_NAME);
List<AnAction> list = new ArrayList<AnAction>(providers.length);