diff --git a/platform/usageView/src/com/intellij/usages/impl/UsageViewImpl.java b/platform/usageView/src/com/intellij/usages/impl/UsageViewImpl.java index e150a87a34ac..af2c5d568ff8 100644 --- a/platform/usageView/src/com/intellij/usages/impl/UsageViewImpl.java +++ b/platform/usageView/src/com/intellij/usages/impl/UsageViewImpl.java @@ -164,7 +164,7 @@ public class UsageViewImpl implements UsageView { private final UsageViewTreeCellRenderer myUsageViewTreeCellRenderer; private Usage myOriginUsage; - UsageViewImpl(@NotNull final Project project, + public UsageViewImpl(@NotNull final Project project, @NotNull UsageViewPresentation presentation, @NotNull UsageTarget[] targets, Factory usageSearcherFactory) { @@ -660,6 +660,10 @@ public class UsageViewImpl implements UsageView { return actionToolbar.getComponent(); } + protected boolean isPreviewUsageActionEnabled() { + return true; + } + @NotNull private JComponent createFiltersToolbar() { final DefaultActionGroup group = new DefaultActionGroup(); @@ -670,7 +674,9 @@ public class UsageViewImpl implements UsageView { } addFilteringActions(group); - group.add(new PreviewUsageAction(this)); + if (isPreviewUsageActionEnabled()) { + group.add(new PreviewUsageAction(this)); + } group.add(new SortMembersAlphabeticallyAction(this)); return toUsageViewToolbar(group); @@ -699,7 +705,7 @@ public class UsageViewImpl implements UsageView { } @NotNull - private AnAction[] createActions() { + protected AnAction[] createActions() { final TreeExpander treeExpander = new TreeExpander() { @Override public void expandAll() { @@ -983,7 +989,7 @@ public class UsageViewImpl implements UsageView { doReRun(); } - private void doReRun() { + protected void doReRun() { close(); com.intellij.usages.UsageViewManager.getInstance(getProject()). searchAndShowUsages(myTargets, myUsageSearcherFactory, true, true, myPresentation, null); @@ -1323,7 +1329,7 @@ public class UsageViewImpl implements UsageView { return new MyPerformOperationRunnable(cannotMakeString, processRunnable, commandName, checkReadOnlyStatus); } - private boolean allTargetsAreValid() { + protected boolean allTargetsAreValid() { for (UsageTarget target : myTargets) { if (!target.isValid()) { return false; diff --git a/platform/usageView/src/com/intellij/usages/impl/UsageViewManagerImpl.java b/platform/usageView/src/com/intellij/usages/impl/UsageViewManagerImpl.java index 373c23989040..57d86a0e6920 100644 --- a/platform/usageView/src/com/intellij/usages/impl/UsageViewManagerImpl.java +++ b/platform/usageView/src/com/intellij/usages/impl/UsageViewManagerImpl.java @@ -197,7 +197,7 @@ public class UsageViewManagerImpl extends UsageViewManager { } } - private static void appendUsages(@NotNull final Usage[] foundUsages, @NotNull final UsageViewImpl usageView) { + protected static void appendUsages(@NotNull final Usage[] foundUsages, @NotNull final UsageViewImpl usageView) { ApplicationManager.getApplication().runReadAction(() -> { for (Usage foundUsage : foundUsages) { usageView.appendUsage(foundUsage);