mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
ability to see all registry keys in search everywhere and edit them
This commit is contained in:
+3
-2
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2015 JetBrains s.r.o.
|
||||
* Copyright 2000-2017 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.
|
||||
@@ -17,6 +17,7 @@ package com.intellij.codeInsight.intention.impl.config;
|
||||
|
||||
import com.intellij.ide.ui.OptionsTopHitProvider;
|
||||
import com.intellij.ide.ui.search.BooleanOptionDescription;
|
||||
import com.intellij.ide.ui.search.OptionDescription;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
@@ -36,7 +37,7 @@ public class IntentionsOptionsTopHitProvider extends OptionsTopHitProvider {
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Collection<BooleanOptionDescription> getOptions(@Nullable Project project) {
|
||||
public Collection<OptionDescription> getOptions(@Nullable Project project) {
|
||||
IntentionManagerSettings settings = IntentionManagerSettings.getInstance();
|
||||
if (settings == null) {
|
||||
return Collections.emptyList();
|
||||
|
||||
+3
-2
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2015 JetBrains s.r.o.
|
||||
* Copyright 2000-2017 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.
|
||||
@@ -17,6 +17,7 @@ package com.intellij.codeInsight.template.impl;
|
||||
|
||||
import com.intellij.ide.ui.OptionsTopHitProvider;
|
||||
import com.intellij.ide.ui.search.BooleanOptionDescription;
|
||||
import com.intellij.ide.ui.search.OptionDescription;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
@@ -36,7 +37,7 @@ public final class LiveTemplatesOptionsTopHitProvider extends OptionsTopHitProvi
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Collection<BooleanOptionDescription> getOptions(@Nullable Project project) {
|
||||
public Collection<OptionDescription> getOptions(@Nullable Project project) {
|
||||
TemplateSettings settings = TemplateSettings.getInstance();
|
||||
if (settings == null) {
|
||||
return Collections.emptyList();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2015 JetBrains s.r.o.
|
||||
* Copyright 2000-2017 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.
|
||||
@@ -291,9 +291,15 @@ public class GotoActionAction extends GotoActionBase implements DumbAware {
|
||||
Component component,
|
||||
@Nullable AnActionEvent e) {
|
||||
if (element instanceof OptionDescription) {
|
||||
final String configurableId = ((OptionDescription)element).getConfigurableId();
|
||||
TransactionGuard.getInstance().submitTransactionLater(project != null ? project : ApplicationManager.getApplication(), () ->
|
||||
ShowSettingsUtilImpl.showSettingsDialog(project, configurableId, enteredText));
|
||||
OptionDescription optionDescription = (OptionDescription)element;
|
||||
final String configurableId = optionDescription.getConfigurableId();
|
||||
Disposable disposable = project != null ? project : ApplicationManager.getApplication();
|
||||
TransactionGuard guard = TransactionGuard.getInstance();
|
||||
if (optionDescription.hasExternalEditor()) {
|
||||
guard.submitTransactionLater(disposable, () -> optionDescription.invokeInternalEditor());
|
||||
} else {
|
||||
guard.submitTransactionLater(disposable, () -> ShowSettingsUtilImpl.showSettingsDialog(project, configurableId, enteredText));
|
||||
}
|
||||
}
|
||||
else {
|
||||
ApplicationManager.getApplication().invokeLater(() -> IdeFocusManager.getInstance(project).doWhenFocusSettlesDown(
|
||||
|
||||
@@ -1225,9 +1225,10 @@ public class SearchEverywhereAction extends AnAction implements CustomComponentA
|
||||
}
|
||||
append(text, attrs);
|
||||
final String id = ((OptionDescription)value).getConfigurableId();
|
||||
final String name1 = myConfigurables.get(id);
|
||||
if (name1 != null) {
|
||||
setLocationString(name1);
|
||||
String location = myConfigurables.get(id);
|
||||
if (location == null) location = ((OptionDescription)value).getValue();
|
||||
if (location != null) {
|
||||
setLocationString(location);
|
||||
}
|
||||
}
|
||||
else if (value instanceof OptionsTopHitProvider) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2015 JetBrains s.r.o.
|
||||
* Copyright 2000-2017 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.
|
||||
@@ -20,6 +20,7 @@ import com.intellij.ide.ui.OptionsTopHitProvider;
|
||||
import com.intellij.ide.ui.PublicMethodBasedOptionDescription;
|
||||
import com.intellij.ide.ui.UISettings;
|
||||
import com.intellij.ide.ui.search.BooleanOptionDescription;
|
||||
import com.intellij.ide.ui.search.OptionDescription;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.ui.FileColorManager;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -40,7 +41,7 @@ public final class FileColorsOptionsTopHitProvider extends OptionsTopHitProvider
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Collection<BooleanOptionDescription> getOptions(@Nullable Project project) {
|
||||
public Collection<OptionDescription> getOptions(@Nullable Project project) {
|
||||
if (project != null) {
|
||||
FileColorManager manager = FileColorManager.getInstance(project);
|
||||
if (manager != null) {
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
package com.intellij.ide.ui;
|
||||
|
||||
import com.intellij.ide.ui.search.BooleanOptionDescription;
|
||||
import com.intellij.ide.ui.search.OptionDescription;
|
||||
import com.intellij.notification.impl.NotificationsConfigurationImpl;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
@@ -31,7 +32,7 @@ import java.util.Collection;
|
||||
public class AppearanceOptionsTopHitProvider extends OptionsTopHitProvider {
|
||||
public static final String ID = "appearance";
|
||||
|
||||
private static final Collection<BooleanOptionDescription> ourOptions = ContainerUtil.immutableList(
|
||||
private static final Collection<OptionDescription> ourOptions = ContainerUtil.immutableList(
|
||||
appearance2("UI: " + messageIde("checkboox.cyclic.scrolling.in.lists"), "cycleScrolling"),
|
||||
appearance("UI: " + messageIde("checkbox.show.icons.in.quick.navigation"), "SHOW_ICONS_IN_QUICK_NAVIGATION"),
|
||||
appearance("UI: " + messageIde("checkbox.position.cursor.on.default.button"), "MOVE_MOUSE_ON_DEFAULT_BUTTON"),
|
||||
@@ -54,7 +55,7 @@ public class AppearanceOptionsTopHitProvider extends OptionsTopHitProvider {
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Collection<BooleanOptionDescription> getOptions(@Nullable Project project) {
|
||||
public Collection<OptionDescription> getOptions(@Nullable Project project) {
|
||||
return ourOptions;
|
||||
}
|
||||
|
||||
@@ -105,7 +106,7 @@ public class AppearanceOptionsTopHitProvider extends OptionsTopHitProvider {
|
||||
}
|
||||
|
||||
public static class Ex extends OptionsTopHitProvider implements CoveredByToggleActions {
|
||||
private static final Collection<BooleanOptionDescription> ourOptions = ContainerUtil.immutableList(
|
||||
private static final Collection<OptionDescription> ourOptions = ContainerUtil.immutableList(
|
||||
appearance("Window: " + "Hide Tool Window Bars", "HIDE_TOOL_STRIPES"),
|
||||
appearance("View: Show Main Toolbar", "SHOW_MAIN_TOOLBAR"),
|
||||
appearance("View: Show Status Bar", "SHOW_STATUS_BAR"),
|
||||
@@ -114,7 +115,7 @@ public class AppearanceOptionsTopHitProvider extends OptionsTopHitProvider {
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Collection<BooleanOptionDescription> getOptions(@Nullable Project project) {
|
||||
public Collection<OptionDescription> getOptions(@Nullable Project project) {
|
||||
return ourOptions;
|
||||
}
|
||||
|
||||
|
||||
+3
-2
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2015 JetBrains s.r.o.
|
||||
* Copyright 2000-2017 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.
|
||||
@@ -16,6 +16,7 @@
|
||||
package com.intellij.ide.ui;
|
||||
|
||||
import com.intellij.ide.ui.search.BooleanOptionDescription;
|
||||
import com.intellij.ide.ui.search.OptionDescription;
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.options.Configurable;
|
||||
import com.intellij.openapi.options.ConfigurationException;
|
||||
@@ -120,7 +121,7 @@ public abstract class ConfigurableOptionsTopHitProvider extends OptionsTopHitPro
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Collection<BooleanOptionDescription> getOptions(@Nullable Project project) {
|
||||
public Collection<OptionDescription> getOptions(@Nullable Project project) {
|
||||
try {
|
||||
Configurable configurable = getConfigurable(project);
|
||||
Component component = configurable.createComponent();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2016 JetBrains s.r.o.
|
||||
* Copyright 2000-2017 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.
|
||||
@@ -16,6 +16,7 @@
|
||||
package com.intellij.ide.ui;
|
||||
|
||||
import com.intellij.ide.ui.search.BooleanOptionDescription;
|
||||
import com.intellij.ide.ui.search.OptionDescription;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -29,7 +30,7 @@ import java.util.Collection;
|
||||
public class EditorOptionsTopHitProvider extends OptionsTopHitProvider {
|
||||
private static final String ID = "editor";
|
||||
|
||||
private static final Collection<BooleanOptionDescription> ourOptions = ContainerUtil.immutableList(
|
||||
private static final Collection<OptionDescription> ourOptions = ContainerUtil.immutableList(
|
||||
editorUI("Appearance: " + messageIde("checkbox.use.antialiased.font.in.editor"), "ANTIALIASING_IN_EDITOR"),
|
||||
editorUI("Appearance: " + messageIde("checkbox.use.lcd.rendered.font.in.editor"), "USE_LCD_RENDERING_IN_EDITOR"),
|
||||
editorApp("Appearance: Caret blinking", "IS_CARET_BLINKING"),
|
||||
@@ -49,7 +50,7 @@ public class EditorOptionsTopHitProvider extends OptionsTopHitProvider {
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Collection<BooleanOptionDescription> getOptions(@Nullable Project project) {
|
||||
public Collection<OptionDescription> getOptions(@Nullable Project project) {
|
||||
return ourOptions;
|
||||
}
|
||||
|
||||
@@ -83,14 +84,14 @@ public class EditorOptionsTopHitProvider extends OptionsTopHitProvider {
|
||||
}
|
||||
|
||||
public static class Ex extends OptionsTopHitProvider implements CoveredByToggleActions {
|
||||
private static final Collection<BooleanOptionDescription> ourOptions = ContainerUtil.immutableList(
|
||||
private static final Collection<OptionDescription> ourOptions = ContainerUtil.immutableList(
|
||||
editorApp("Appearance: " + messageApp("checkbox.show.line.numbers"), "ARE_LINE_NUMBERS_SHOWN"),
|
||||
editorApp("Appearance: " + messageApp("checkbox.show.gutter.icons"), "ARE_GUTTER_ICONS_SHOWN")
|
||||
);
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Collection<BooleanOptionDescription> getOptions(@Nullable Project project) {
|
||||
public Collection<OptionDescription> getOptions(@Nullable Project project) {
|
||||
return ourOptions;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2016 JetBrains s.r.o.
|
||||
* Copyright 2000-2017 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.
|
||||
@@ -16,7 +16,7 @@
|
||||
package com.intellij.ide.ui;
|
||||
|
||||
import com.intellij.codeInspection.ex.Tools;
|
||||
import com.intellij.ide.ui.search.BooleanOptionDescription;
|
||||
import com.intellij.ide.ui.search.OptionDescription;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.profile.codeInspection.InspectionProjectProfileManager;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
@@ -37,9 +37,9 @@ public class InspectionsTopHitProvider extends OptionsTopHitProvider {
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Collection<BooleanOptionDescription> getOptions(@Nullable Project project) {
|
||||
public Collection<OptionDescription> getOptions(@Nullable Project project) {
|
||||
if (project == null) return ContainerUtil.emptyList();
|
||||
List<BooleanOptionDescription> result = ContainerUtil.newArrayList();
|
||||
List<OptionDescription> result = ContainerUtil.newArrayList();
|
||||
List<Tools> tools = InspectionProjectProfileManager.getInstance(project).getCurrentProfile().getAllEnabledInspectionTools(project);
|
||||
for (Tools tool : tools) {
|
||||
result.add(new ToolOptionDescription(tool, project));
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2015 JetBrains s.r.o.
|
||||
* Copyright 2000-2017 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.
|
||||
@@ -17,7 +17,7 @@ package com.intellij.ide.ui;
|
||||
|
||||
import com.intellij.ide.IdeBundle;
|
||||
import com.intellij.ide.SearchTopHitProvider;
|
||||
import com.intellij.ide.ui.search.BooleanOptionDescription;
|
||||
import com.intellij.ide.ui.search.OptionDescription;
|
||||
import com.intellij.openapi.application.ApplicationBundle;
|
||||
import com.intellij.openapi.keymap.KeyMapBundle;
|
||||
import com.intellij.openapi.project.Project;
|
||||
@@ -37,7 +37,7 @@ import java.util.List;
|
||||
*/
|
||||
public abstract class OptionsTopHitProvider implements SearchTopHitProvider {
|
||||
@NotNull
|
||||
public abstract Collection<BooleanOptionDescription> getOptions(@Nullable Project project);
|
||||
public abstract Collection<OptionDescription> getOptions(@Nullable Project project);
|
||||
|
||||
@Override
|
||||
public final void consumeTopHits(@NonNls String pattern, Consumer<Object> collector, Project project) {
|
||||
@@ -57,7 +57,7 @@ public abstract class OptionsTopHitProvider implements SearchTopHitProvider {
|
||||
pattern = pattern.substring(id.length()).trim().toLowerCase();
|
||||
}
|
||||
final MinusculeMatcher matcher = NameUtil.buildMatcher("*" + pattern, NameUtil.MatchingCaseSensitivity.NONE);
|
||||
for (BooleanOptionDescription option : getOptions(project)) {
|
||||
for (OptionDescription option : getOptions(project)) {
|
||||
if (matcher.matches(option.getOption())) {
|
||||
collector.consume(option);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2015 JetBrains s.r.o.
|
||||
* Copyright 2000-2017 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.
|
||||
@@ -17,7 +17,7 @@ package com.intellij.ide.ui;
|
||||
|
||||
import com.intellij.ide.plugins.IdeaPluginDescriptor;
|
||||
import com.intellij.ide.plugins.PluginManagerCore;
|
||||
import com.intellij.ide.ui.search.BooleanOptionDescription;
|
||||
import com.intellij.ide.ui.search.OptionDescription;
|
||||
import com.intellij.openapi.application.ex.ApplicationInfoEx;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -32,8 +32,8 @@ import java.util.Collection;
|
||||
public class PluginOptionsTopHitProvider extends OptionsTopHitProvider {
|
||||
@NotNull
|
||||
@Override
|
||||
public Collection<BooleanOptionDescription> getOptions(@Nullable Project project) {
|
||||
ArrayList<BooleanOptionDescription> options = new ArrayList<>();
|
||||
public Collection<OptionDescription> getOptions(@Nullable Project project) {
|
||||
ArrayList<OptionDescription> options = new ArrayList<>();
|
||||
ApplicationInfoEx applicationInfo = ApplicationInfoEx.getInstanceEx();
|
||||
for (IdeaPluginDescriptor pluginDescriptor : PluginManagerCore.getPlugins()) {
|
||||
if (applicationInfo.isEssentialPlugin(pluginDescriptor.getPluginId().getIdString())) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2015 JetBrains s.r.o.
|
||||
* Copyright 2000-2017 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.
|
||||
@@ -15,7 +15,7 @@
|
||||
*/
|
||||
package com.intellij.ide.ui;
|
||||
|
||||
import com.intellij.ide.ui.search.BooleanOptionDescription;
|
||||
import com.intellij.ide.ui.search.OptionDescription;
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.registry.Registry;
|
||||
@@ -33,7 +33,7 @@ import java.util.List;
|
||||
public class RegistryOptionsTopHitProvider extends OptionsTopHitProvider {
|
||||
@NotNull
|
||||
@Override
|
||||
public Collection<BooleanOptionDescription> getOptions(@Nullable Project project) {
|
||||
public Collection<OptionDescription> getOptions(@Nullable Project project) {
|
||||
return Holder.ourValues;
|
||||
}
|
||||
|
||||
@@ -48,10 +48,10 @@ public class RegistryOptionsTopHitProvider extends OptionsTopHitProvider {
|
||||
}
|
||||
|
||||
private static class Holder {
|
||||
private static final List<BooleanOptionDescription> ourValues = initValues();
|
||||
private static final List<OptionDescription> ourValues = initValues();
|
||||
|
||||
private static List<BooleanOptionDescription> initValues() {
|
||||
final List<BooleanOptionDescription> result = new ArrayList<>();
|
||||
private static List<OptionDescription> initValues() {
|
||||
final List<OptionDescription> result = new ArrayList<>();
|
||||
for (RegistryValue value : Registry.getAll()) {
|
||||
if (value.isBoolean()) {
|
||||
final String key = value.getKey();
|
||||
@@ -61,6 +61,8 @@ public class RegistryOptionsTopHitProvider extends OptionsTopHitProvider {
|
||||
} else {
|
||||
result.add(optionDescriptor);
|
||||
}
|
||||
} else {
|
||||
result.add(new RegistryTextOptionDescriptor(value));
|
||||
}
|
||||
}
|
||||
return result;
|
||||
|
||||
@@ -0,0 +1,94 @@
|
||||
/*
|
||||
* Copyright 2000-2017 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.ui;
|
||||
|
||||
import com.intellij.ide.ui.search.OptionDescription;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.ui.InputValidatorEx;
|
||||
import com.intellij.openapi.ui.Messages;
|
||||
import com.intellij.openapi.util.registry.RegistryValue;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.openapi.wm.impl.IdeFrameImpl;
|
||||
import com.intellij.ui.Changeable;
|
||||
import com.intellij.ui.ColorChooser;
|
||||
import com.intellij.ui.ColorUtil;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.awt.*;
|
||||
|
||||
/**
|
||||
* @author Konstantin Bulenkov
|
||||
*/
|
||||
public class RegistryTextOptionDescriptor extends OptionDescription implements Changeable {
|
||||
private RegistryValue myValue;
|
||||
|
||||
public RegistryTextOptionDescriptor(RegistryValue value) {
|
||||
super(value.getKey());
|
||||
myValue = value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasChanged() {
|
||||
return myValue.isChangedFromDefault();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getOption() {
|
||||
return myValue.getKey();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getValue() {
|
||||
return myValue.asString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasExternalEditor() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void invokeInternalEditor() {
|
||||
if (myValue.getKey().contains("color") && ColorUtil.fromHex(myValue.asString(), null) != null) {
|
||||
Color color = ColorChooser.chooseColor(IdeFrameImpl.getActiveFrame(), "Change Color For '" + myValue.getKey() + "'", ColorUtil.fromHex(myValue.asString()));
|
||||
if (color != null) {
|
||||
myValue.setValue(ColorUtil.toHex(color));
|
||||
}
|
||||
} else {
|
||||
String s = Messages.showInputDialog((Project)null, "Enter new value for '" + myValue.getKey() + "'", "Change Registry Value", null,
|
||||
myValue.asString(), new InputValidatorEx() {
|
||||
@Nullable
|
||||
@Override
|
||||
public String getErrorText(String inputString) {
|
||||
return canClose(inputString) ? null : "Should not be empty";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkInput(String inputString) {
|
||||
return canClose(inputString);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canClose(String inputString) {
|
||||
return !StringUtil.isEmpty(inputString);
|
||||
}
|
||||
});
|
||||
if (s != null) {
|
||||
myValue.setValue(s);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
* Copyright 2000-2017 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.
|
||||
@@ -17,6 +17,7 @@ package com.intellij.ide.ui;
|
||||
|
||||
import com.intellij.ide.GeneralSettings;
|
||||
import com.intellij.ide.ui.search.BooleanOptionDescription;
|
||||
import com.intellij.ide.ui.search.OptionDescription;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
@@ -29,7 +30,7 @@ import java.util.Collections;
|
||||
* @author Sergey.Malenkov
|
||||
*/
|
||||
public final class SystemOptionsTopHitProvider extends OptionsTopHitProvider {
|
||||
private static final Collection<BooleanOptionDescription> ourOptions = Collections.unmodifiableCollection(Arrays.asList(
|
||||
private static final Collection<OptionDescription> ourOptions = Collections.unmodifiableCollection(Arrays.asList(
|
||||
option(messageIde("checkbox.show.tips.on.startup"), "showTipsOnStartup", "setShowTipsOnStartup"),
|
||||
option(messageIde("checkbox.reopen.last.project.on.startup"), "isReopenLastProject", "setReopenLastProject"),
|
||||
option(messageIde("checkbox.support.screen.readers"), "isSupportScreenReaders", "setSupportScreenReaders"),
|
||||
@@ -44,7 +45,7 @@ public final class SystemOptionsTopHitProvider extends OptionsTopHitProvider {
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Collection<BooleanOptionDescription> getOptions(@Nullable Project project) {
|
||||
public Collection<OptionDescription> getOptions(@Nullable Project project) {
|
||||
return ourOptions;
|
||||
}
|
||||
|
||||
|
||||
+3
-2
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
* Copyright 2000-2017 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.
|
||||
@@ -19,6 +19,7 @@ import com.intellij.ide.ui.OptionsTopHitProvider;
|
||||
import com.intellij.ide.ui.PublicFieldBasedOptionDescription;
|
||||
import com.intellij.ide.ui.PublicMethodBasedOptionDescription;
|
||||
import com.intellij.ide.ui.search.BooleanOptionDescription;
|
||||
import com.intellij.ide.ui.search.OptionDescription;
|
||||
import com.intellij.openapi.application.ApplicationBundle;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.vcs.ProjectLevelVcsManager;
|
||||
@@ -46,7 +47,7 @@ public final class VcsOptionsTopHitProvider extends OptionsTopHitProvider {
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Collection<BooleanOptionDescription> getOptions(@Nullable Project project) {
|
||||
public Collection<OptionDescription> getOptions(@Nullable Project project) {
|
||||
if (project == null || ProjectLevelVcsManager.getInstance(project).getAllVcss().length == 0) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
+3
-2
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
* Copyright 2000-2017 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.
|
||||
@@ -19,6 +19,7 @@ import com.intellij.CvsBundle;
|
||||
import com.intellij.ide.ui.OptionsTopHitProvider;
|
||||
import com.intellij.ide.ui.PublicFieldBasedOptionDescription;
|
||||
import com.intellij.ide.ui.search.BooleanOptionDescription;
|
||||
import com.intellij.ide.ui.search.OptionDescription;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.vcs.ProjectLevelVcsManager;
|
||||
import com.intellij.openapi.vcs.impl.VcsDescriptor;
|
||||
@@ -40,7 +41,7 @@ public final class CvsOptionsTopHitProvider extends OptionsTopHitProvider {
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Collection<BooleanOptionDescription> getOptions(@Nullable Project project) {
|
||||
public Collection<OptionDescription> getOptions(@Nullable Project project) {
|
||||
if (project != null) {
|
||||
for (VcsDescriptor descriptor : ProjectLevelVcsManager.getInstance(project).getAllVcss()) {
|
||||
if ("CVS".equals(descriptor.getDisplayName())) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
* Copyright 2000-2017 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.
|
||||
@@ -19,6 +19,7 @@ import com.intellij.dvcs.branch.DvcsSyncSettings;
|
||||
import com.intellij.ide.ui.OptionsTopHitProvider;
|
||||
import com.intellij.ide.ui.PublicMethodBasedOptionDescription;
|
||||
import com.intellij.ide.ui.search.BooleanOptionDescription;
|
||||
import com.intellij.ide.ui.search.OptionDescription;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.vcs.ProjectLevelVcsManager;
|
||||
import com.intellij.openapi.vcs.impl.VcsDescriptor;
|
||||
@@ -41,7 +42,7 @@ public final class GitOptionsTopHitProvider extends OptionsTopHitProvider {
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Collection<BooleanOptionDescription> getOptions(@Nullable Project project) {
|
||||
public Collection<OptionDescription> getOptions(@Nullable Project project) {
|
||||
if (project != null) {
|
||||
for (VcsDescriptor descriptor : ProjectLevelVcsManager.getInstance(project).getAllVcss()) {
|
||||
if ("Git".equals(descriptor.getDisplayName())) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
* Copyright 2000-2017 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.
|
||||
@@ -18,6 +18,7 @@ package org.zmlx.hg4idea;
|
||||
import com.intellij.ide.ui.OptionsTopHitProvider;
|
||||
import com.intellij.ide.ui.PublicMethodBasedOptionDescription;
|
||||
import com.intellij.ide.ui.search.BooleanOptionDescription;
|
||||
import com.intellij.ide.ui.search.OptionDescription;
|
||||
import com.intellij.openapi.components.ServiceManager;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.vcs.ProjectLevelVcsManager;
|
||||
@@ -40,7 +41,7 @@ public final class HgOptionsTopHitProvider extends OptionsTopHitProvider {
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Collection<BooleanOptionDescription> getOptions(@Nullable Project project) {
|
||||
public Collection<OptionDescription> getOptions(@Nullable Project project) {
|
||||
if (project != null) {
|
||||
for (VcsDescriptor descriptor : ProjectLevelVcsManager.getInstance(project).getAllVcss()) {
|
||||
if ("Mercurial".equals(descriptor.getDisplayName())) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
* Copyright 2000-2017 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.
|
||||
@@ -18,6 +18,7 @@ package org.jetbrains.idea.svn;
|
||||
import com.intellij.ide.ui.OptionsTopHitProvider;
|
||||
import com.intellij.ide.ui.PublicMethodBasedOptionDescription;
|
||||
import com.intellij.ide.ui.search.BooleanOptionDescription;
|
||||
import com.intellij.ide.ui.search.OptionDescription;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.vcs.ProjectLevelVcsManager;
|
||||
import com.intellij.openapi.vcs.impl.VcsDescriptor;
|
||||
@@ -39,7 +40,7 @@ public final class SvnOptionsTopHitProvider extends OptionsTopHitProvider {
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Collection<BooleanOptionDescription> getOptions(@Nullable Project project) {
|
||||
public Collection<OptionDescription> getOptions(@Nullable Project project) {
|
||||
if (project != null) {
|
||||
for (VcsDescriptor descriptor : ProjectLevelVcsManager.getInstance(project).getAllVcss()) {
|
||||
if ("Subversion".equals(descriptor.getDisplayName())) {
|
||||
|
||||
Reference in New Issue
Block a user