This commit is contained in:
Alexey Kudravtsev
2012-08-15 14:03:15 +04:00
parent 9aa52a1f48
commit fa3529fe18
6 changed files with 31 additions and 10 deletions
@@ -24,16 +24,16 @@ public class JavaClassFindUsagesOptions extends JavaFindUsagesOptions {
@Override
protected void addUsageTypes(LinkedHashSet<String> strings) {
if (this.isUsages || this.isMethodsUsages || this.isFieldsUsages) {
if (isUsages || isMethodsUsages || isFieldsUsages) {
strings.add(FindBundle.message("find.usages.panel.title.usages"));
}
if (this.isDerivedClasses) {
if (isDerivedClasses) {
strings.add(FindBundle.message("find.usages.panel.title.derived.classes"));
}
if (this.isImplementingClasses) {
if (isImplementingClasses) {
strings.add(FindBundle.message("find.usages.panel.title.implementing.classes"));
}
if (this.isDerivedInterfaces) {
if (isDerivedInterfaces) {
strings.add(FindBundle.message("find.usages.panel.title.derived.interfaces"));
}
}
@@ -88,6 +88,7 @@ public class ScopeChooserCombo extends ComboboxWithBrowseButton implements Dispo
myPrevSearchFiles = prevSearchWholeFiles;
myProject = project;
myScopeListener = new NamedScopesHolder.ScopeListener() {
@Override
public void scopesChanged() {
final SearchScope selectedScope = getSelectedScope();
rebuildModel();
@@ -140,6 +141,7 @@ public class ScopeChooserCombo extends ComboboxWithBrowseButton implements Dispo
private ActionListener createScopeChooserListener() {
return new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
final String selection = getSelectedScopeName();
final EditScopesDialog dlg = EditScopesDialog.showDialog(myProject, selection);
@@ -313,22 +315,27 @@ public class ScopeChooserCombo extends ComboboxWithBrowseButton implements Dispo
}
if (!files.isEmpty()) {
GlobalSearchScope prev = new GlobalSearchScope(project) {
@Override
public String getDisplayName() {
return IdeBundle.message("scope.files.in.previous.search.result");
}
@Override
public boolean contains(VirtualFile file) {
return files.contains(file);
}
@Override
public int compare(VirtualFile file1, VirtualFile file2) {
return 0;
}
@Override
public boolean isSearchInModuleContent(@NotNull Module aModule) {
return true;
}
@Override
public boolean isSearchInLibraries() {
return true;
}
@@ -447,12 +454,12 @@ public class ScopeChooserCombo extends ComboboxWithBrowseButton implements Dispo
@Override
public void setSelectedIndex(final int anIndex) {
Object item = super.getItemAt(anIndex);
Object item = getItemAt(anIndex);
if (!(item instanceof ScopeSeparator)) {
super.setSelectedIndex(anIndex);
}
else if (myDirection != 0) {
item = super.getItemAt(anIndex + myDirection);
item = getItemAt(anIndex + myDirection);
if (!(item instanceof ScopeSeparator)) {
super.setSelectedIndex(anIndex + myDirection);
}
@@ -461,7 +468,7 @@ public class ScopeChooserCombo extends ComboboxWithBrowseButton implements Dispo
}
private static class ScopeSeparator extends ScopeDescriptor {
private String myText;
private final String myText;
public ScopeSeparator(final String text) {
super(null);
@@ -15,6 +15,8 @@
*/
package com.intellij.openapi.actionSystem;
import org.jetbrains.annotations.NotNull;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
@@ -26,6 +28,8 @@ public class CompositeShortcutSet implements ShortcutSet {
mySets = sets;
}
@Override
@NotNull
public Shortcut[] getShortcuts() {
List<Shortcut> result = new ArrayList<Shortcut>();
for (ShortcutSet each : mySets) {
@@ -15,6 +15,8 @@
*/
package com.intellij.openapi.actionSystem;
import org.jetbrains.annotations.NotNull;
import javax.swing.*;
/**
@@ -28,7 +30,7 @@ public final class CustomShortcutSet implements ShortcutSet {
* Creates <code>CustomShortcutSet</code> which contains only one
* single stroke keyboard shortcut.
*/
public CustomShortcutSet(KeyStroke keyStroke){
public CustomShortcutSet(@NotNull KeyStroke keyStroke){
this(new KeyboardShortcut(keyStroke, null));
}
@@ -38,15 +40,18 @@ public final class CustomShortcutSet implements ShortcutSet {
*
* @param shortcuts keyboard shortcuts
*/
public CustomShortcutSet(Shortcut... shortcuts){
public CustomShortcutSet(@NotNull Shortcut... shortcuts){
myShortcuts = shortcuts.length == 0 ? Shortcut.EMPTY_ARRAY : shortcuts.clone();
}
@Override
@NotNull
public Shortcut[] getShortcuts(){
return myShortcuts.length == 0 ? Shortcut.EMPTY_ARRAY : myShortcuts.clone();
}
public static CustomShortcutSet fromString(String... keyboardShortcuts) {
@NotNull
public static CustomShortcutSet fromString(@NotNull String... keyboardShortcuts) {
final KeyboardShortcut[] shortcuts = new KeyboardShortcut[keyboardShortcuts.length];
for (int i = 0; i < keyboardShortcuts.length; i++) {
shortcuts[i] = KeyboardShortcut.fromString(keyboardShortcuts[i]);
@@ -15,6 +15,8 @@
*/
package com.intellij.openapi.actionSystem;
import org.jetbrains.annotations.NotNull;
/**
* Represents a set of keyboard and/or mouse shortcuts.
*
@@ -26,5 +28,6 @@ public interface ShortcutSet {
* @return array of keyboard <code>Shortcut</code>s that are in the set.
* The method returns an empty array if there are no keyboard <code>Shortcuts</code>
*/
@NotNull
Shortcut[] getShortcuts();
}
@@ -19,6 +19,7 @@ import com.intellij.openapi.actionSystem.Shortcut;
import com.intellij.openapi.actionSystem.ShortcutSet;
import com.intellij.openapi.keymap.Keymap;
import com.intellij.openapi.keymap.KeymapManager;
import org.jetbrains.annotations.NotNull;
/**
* Please do not use this class outside impl package!!!
@@ -35,6 +36,7 @@ final class ProxyShortcutSet implements ShortcutSet {
myKeymapManager = keymapManager;
}
@NotNull
public Shortcut[] getShortcuts() {
Keymap keymap=myKeymapManager.getActiveKeymap();
return keymap.getShortcuts(myActionId);