diff --git a/platform/lang-impl/src/com/intellij/find/actions/ShowUsagesAction.java b/platform/lang-impl/src/com/intellij/find/actions/ShowUsagesAction.java index 6bcbd42a0ebf..4dffeb5f5e5e 100644 --- a/platform/lang-impl/src/com/intellij/find/actions/ShowUsagesAction.java +++ b/platform/lang-impl/src/com/intellij/find/actions/ShowUsagesAction.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2010 JetBrains s.r.o. + * 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. @@ -460,7 +460,8 @@ public class ShowUsagesAction extends AnAction implements PopupAction { else { s = title + " (" + UsageViewBundle.message("usages.n", usages.size()) + " found)"; } - builder.setTitle(suggestSecondInvocation(options, handler, s)); + builder.setTitle("" + s + ""); + builder.setAdText(getSecondInvocationTitle(options, handler)); } builder.setMovable(true).setResizable(true); @@ -555,16 +556,26 @@ public class ShowUsagesAction extends AnAction implements PopupAction { } private static String suggestSecondInvocation(FindUsagesOptions options, FindUsagesHandler handler, String s) { - if (getShowUsagesShortcut() != null) { - GlobalSearchScope maximalScope = getMaximalScope(handler); - if (!notNullizeScope(options, handler.getProject()).equals(maximalScope)) { - s += "
Press " + KeymapUtil.getShortcutText(getShowUsagesShortcut()) + - " again to search in " + maximalScope.getDisplayName() + ""; - } + final String title = getSecondInvocationTitle(options, handler); + + if (title != null) { + s += "
Press " + title + ""; } return "" + s + ""; } + @Nullable + private static String getSecondInvocationTitle(FindUsagesOptions options, FindUsagesHandler handler) { + if (getShowUsagesShortcut() != null) { + GlobalSearchScope maximalScope = getMaximalScope(handler); + if (!notNullizeScope(options, handler.getProject()).equals(maximalScope)) { + return "Press " + KeymapUtil.getShortcutText(getShowUsagesShortcut()) + + " again to search in " + maximalScope.getDisplayName(); + } + } + return null; + } + private void searchEverywhere(FindUsagesOptions options, FindUsagesHandler handler, Editor editor, diff --git a/platform/util/src/com/intellij/ui/CaptionPanel.java b/platform/util/src/com/intellij/ui/CaptionPanel.java index ec2c436517ef..0d2b16cf178d 100644 --- a/platform/util/src/com/intellij/ui/CaptionPanel.java +++ b/platform/util/src/com/intellij/ui/CaptionPanel.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * 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. @@ -87,7 +87,7 @@ public class CaptionPanel extends JPanel { public void addSettingsComponent(Component component) { if (mySettingComponent == null) { - mySettingComponent = new JPanel(new FlowLayout()); + mySettingComponent = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 0)); mySettingComponent.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT); add(mySettingComponent, BorderLayout.WEST); mySettingComponent.setOpaque(false);