mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-05 01:50:56 +07:00
IDEA-CR-4183 use getBoolean(name) if default value equals to false (because it is default value)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2013 JetBrains s.r.o.
|
||||
* Copyright 2000-2015 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,8 +18,8 @@ package com.intellij.compiler.classFilesIndex.chainsSearch.completion.lookup;
|
||||
import com.intellij.codeInsight.completion.InsertionContext;
|
||||
import com.intellij.codeInsight.completion.JavaMethodCallElement;
|
||||
import com.intellij.codeInsight.completion.StaticallyImportable;
|
||||
import com.intellij.compiler.classFilesIndex.chainsSearch.completion.lookup.sub.SubLookupElement;
|
||||
import com.intellij.codeInsight.lookup.AutoCompletionPolicy;
|
||||
import com.intellij.compiler.classFilesIndex.chainsSearch.completion.lookup.sub.SubLookupElement;
|
||||
import com.intellij.ide.util.PropertiesComponent;
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.psi.PsiClass;
|
||||
@@ -64,7 +64,7 @@ public class ChainCompletionMethodCallLookupElement extends JavaMethodCallElemen
|
||||
|
||||
private void configureAutoCompletionPolicy() {
|
||||
if (ApplicationManager.getApplication().isUnitTestMode()) {
|
||||
if (PropertiesComponent.getInstance(myMethod.getProject()).getBoolean(PROP_METHODS_CHAIN_COMPLETION_AUTO_COMPLETION, false)) {
|
||||
if (PropertiesComponent.getInstance(myMethod.getProject()).getBoolean(PROP_METHODS_CHAIN_COMPLETION_AUTO_COMPLETION)) {
|
||||
setAutoCompletionPolicy(AutoCompletionPolicy.GIVE_CHANCE_TO_OVERWRITE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -183,7 +183,7 @@ public abstract class IntroduceVariableBase extends IntroduceHandlerBase {
|
||||
}
|
||||
|
||||
public static boolean isPreferStatements() {
|
||||
return Boolean.valueOf(PropertiesComponent.getInstance().getBoolean(PREFER_STATEMENTS_OPTION, false)) || Registry.is(PREFER_STATEMENTS_OPTION, false);
|
||||
return Boolean.valueOf(PropertiesComponent.getInstance().getBoolean(PREFER_STATEMENTS_OPTION)) || Registry.is(PREFER_STATEMENTS_OPTION, false);
|
||||
}
|
||||
|
||||
public static List<PsiExpression> collectExpressions(final PsiFile file,
|
||||
|
||||
@@ -106,7 +106,7 @@ public class CreateTestAction extends PsiElementBaseIntentionAction {
|
||||
final PropertiesComponent propertiesComponent = PropertiesComponent.getInstance();
|
||||
final HashSet<VirtualFile> testFolders = new HashSet<VirtualFile>();
|
||||
checkForTestRoots(srcModule, testFolders);
|
||||
if (testFolders.isEmpty() && !propertiesComponent.getBoolean(CREATE_TEST_IN_THE_SAME_ROOT, false)) {
|
||||
if (testFolders.isEmpty() && !propertiesComponent.getBoolean(CREATE_TEST_IN_THE_SAME_ROOT)) {
|
||||
if (Messages.showOkCancelDialog(project, "Create test in the same source root?", "No Test Roots Found", Messages.getQuestionIcon()) !=
|
||||
Messages.OK) {
|
||||
return;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
* Copyright 2000-2015 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.
|
||||
@@ -33,7 +33,7 @@ public abstract class JavaFileStructureTestCase extends FileStructureTestBase {
|
||||
@Override
|
||||
public void setUp() throws Exception {
|
||||
super.setUp();
|
||||
myShowAnonymousByDefault = PropertiesComponent.getInstance().getBoolean(getAnonymousPropertyName(), false);
|
||||
myShowAnonymousByDefault = PropertiesComponent.getInstance().getBoolean(getAnonymousPropertyName());
|
||||
if (getTestName(false).contains("Anonymous")) {
|
||||
setShowAnonymous(true);
|
||||
}
|
||||
@@ -56,7 +56,7 @@ public abstract class JavaFileStructureTestCase extends FileStructureTestBase {
|
||||
|
||||
@Override
|
||||
public void tearDown() throws Exception {
|
||||
PropertiesComponent.getInstance().setValue(getAnonymousPropertyName(), Boolean.toString(myShowAnonymousByDefault));
|
||||
PropertiesComponent.getInstance().setValue(getAnonymousPropertyName(), myShowAnonymousByDefault);
|
||||
super.tearDown();
|
||||
}
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ import com.intellij.util.messages.Topic;
|
||||
*/
|
||||
public class PowerSaveMode {
|
||||
private static final String POWER_SAVE_MODE = "power.save.mode";
|
||||
private boolean myEnabled = PropertiesComponent.getInstance().getBoolean(POWER_SAVE_MODE, false);
|
||||
private boolean myEnabled = PropertiesComponent.getInstance().getBoolean(POWER_SAVE_MODE);
|
||||
private final MessageBus myBus;
|
||||
|
||||
public PowerSaveMode(MessageBus bus) {
|
||||
@@ -41,7 +41,7 @@ public class PowerSaveMode {
|
||||
if (instance.myEnabled != value) {
|
||||
instance.myEnabled = value;
|
||||
instance.myBus.syncPublisher(TOPIC).powerSaveStateChanged();
|
||||
PropertiesComponent.getInstance().setValue(POWER_SAVE_MODE, String.valueOf(value), "false");
|
||||
PropertiesComponent.getInstance().setValue(POWER_SAVE_MODE, value);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ public class WarnOnDeletion extends ToggleAction implements DumbAware {
|
||||
}
|
||||
|
||||
public static boolean isWarnWhenDeleteItems() {
|
||||
return PropertiesComponent.getInstance().getBoolean(PROPERTY_NAME, false);
|
||||
return PropertiesComponent.getInstance().getBoolean(PROPERTY_NAME);
|
||||
}
|
||||
|
||||
public static void setWarnWhenDeleteItems(boolean warn) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
* Copyright 2000-2015 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.
|
||||
@@ -53,11 +53,11 @@ public class LastRunReformatCodeOptionsProvider {
|
||||
}
|
||||
|
||||
public boolean getLastOptimizeImports() {
|
||||
return myPropertiesComponent.getBoolean(OPTIMIZE_IMPORTS_KEY, false);
|
||||
return myPropertiesComponent.getBoolean(OPTIMIZE_IMPORTS_KEY);
|
||||
}
|
||||
|
||||
public TextRangeType getLastTextRangeType() {
|
||||
return myPropertiesComponent.getBoolean(PROCESS_CHANGED_TEXT_KEY, false) ? TextRangeType.VCS_CHANGED_TEXT : TextRangeType.WHOLE_FILE;
|
||||
return myPropertiesComponent.getBoolean(PROCESS_CHANGED_TEXT_KEY) ? TextRangeType.VCS_CHANGED_TEXT : TextRangeType.WHOLE_FILE;
|
||||
}
|
||||
|
||||
public void saveProcessVcsChangedTextState(boolean value) {
|
||||
@@ -66,16 +66,16 @@ public class LastRunReformatCodeOptionsProvider {
|
||||
}
|
||||
|
||||
public void saveRearrangeCodeState(boolean value) {
|
||||
myPropertiesComponent.setValue(REARRANGE_ENTRIES_KEY, Boolean.toString(value));
|
||||
myPropertiesComponent.setValue(REARRANGE_ENTRIES_KEY, value);
|
||||
}
|
||||
|
||||
public boolean getLastRearrangeCode() {
|
||||
return myPropertiesComponent.getBoolean(REARRANGE_ENTRIES_KEY, false);
|
||||
return myPropertiesComponent.getBoolean(REARRANGE_ENTRIES_KEY);
|
||||
}
|
||||
|
||||
public boolean isRearrangeCode(@NotNull Language language) {
|
||||
String key = getRearrangeCodeKeyFor(language);
|
||||
return myPropertiesComponent.getBoolean(key, false);
|
||||
return myPropertiesComponent.getBoolean(key);
|
||||
}
|
||||
|
||||
private static String getRearrangeCodeKeyFor(@NotNull Language language) {
|
||||
|
||||
@@ -99,7 +99,7 @@ public class DuplexConsoleView<S extends ConsoleView, T extends ConsoleView> ext
|
||||
if (myStateStorageKey == null) {
|
||||
return false;
|
||||
}
|
||||
return PropertiesComponent.getInstance().getBoolean(myStateStorageKey, false);
|
||||
return PropertiesComponent.getInstance().getBoolean(myStateStorageKey);
|
||||
}
|
||||
|
||||
public void enableConsole(boolean primary) {
|
||||
|
||||
@@ -1,3 +1,18 @@
|
||||
/*
|
||||
* Copyright 2000-2015 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.execution.console;
|
||||
|
||||
import com.intellij.codeInsight.daemon.DaemonCodeAnalyzer;
|
||||
@@ -174,7 +189,7 @@ public final class LanguageConsoleBuilder {
|
||||
|
||||
if (processInputStateKey != null) {
|
||||
assert executeActionHandler != null;
|
||||
if (PropertiesComponent.getInstance().getBoolean(processInputStateKey, false)) {
|
||||
if (PropertiesComponent.getInstance().getBoolean(processInputStateKey)) {
|
||||
executeActionHandler.myUseProcessStdIn = true;
|
||||
DaemonCodeAnalyzer daemonCodeAnalyzer = DaemonCodeAnalyzer.getInstance(consoleView.getProject());
|
||||
daemonCodeAnalyzer.setHighlightingEnabled(consoleView.getFile(), false);
|
||||
|
||||
@@ -1,3 +1,18 @@
|
||||
/*
|
||||
* Copyright 2000-2015 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.execution.console;
|
||||
|
||||
import com.intellij.codeInsight.daemon.DaemonCodeAnalyzer;
|
||||
@@ -24,7 +39,7 @@ final class UseConsoleInputAction extends ToggleAction implements DumbAware {
|
||||
super("Use Console Input", null, AllIcons.Debugger.CommandLine);
|
||||
|
||||
this.processInputStateKey = processInputStateKey;
|
||||
useProcessStdIn = PropertiesComponent.getInstance().getBoolean(processInputStateKey, false);
|
||||
useProcessStdIn = PropertiesComponent.getInstance().getBoolean(processInputStateKey);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -42,12 +57,7 @@ final class UseConsoleInputAction extends ToggleAction implements DumbAware {
|
||||
PsiFile file = consoleView.getFile();
|
||||
daemonCodeAnalyzer.setHighlightingEnabled(file, state);
|
||||
daemonCodeAnalyzer.restart(file);
|
||||
if (state) {
|
||||
PropertiesComponent.getInstance().unsetValue(processInputStateKey);
|
||||
}
|
||||
else {
|
||||
PropertiesComponent.getInstance().setValue(processInputStateKey, "true");
|
||||
}
|
||||
PropertiesComponent.getInstance().setValue(processInputStateKey, useProcessStdIn);
|
||||
|
||||
List<AnAction> actions = ActionUtil.getActions(consoleView.getConsoleEditor().getComponent());
|
||||
ConsoleExecuteAction action = ContainerUtil.findInstance(actions, ConsoleExecuteAction.class);
|
||||
|
||||
@@ -42,7 +42,7 @@ public class PowerSaveModeNotifier implements StartupActivity {
|
||||
}
|
||||
|
||||
static void notifyOnPowerSaveMode(Project project) {
|
||||
if (PropertiesComponent.getInstance().getBoolean(IGNORE_POWER_SAVE_MODE, false)) {
|
||||
if (PropertiesComponent.getInstance().getBoolean(IGNORE_POWER_SAVE_MODE)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -871,7 +871,7 @@ public class FileStructurePopup implements Disposable, TreeActionsOwner {
|
||||
private static boolean getDefaultValue(TreeAction action) {
|
||||
if (action instanceof PropertyOwner) {
|
||||
final String propertyName = ((PropertyOwner)action).getPropertyName();
|
||||
return PropertiesComponent.getInstance().getBoolean(TreeStructureUtil.getPropertyName(propertyName), false);
|
||||
return PropertiesComponent.getInstance().getBoolean(TreeStructureUtil.getPropertyName(propertyName));
|
||||
}
|
||||
|
||||
return false;
|
||||
@@ -880,7 +880,7 @@ public class FileStructurePopup implements Disposable, TreeActionsOwner {
|
||||
private static void saveState(TreeAction action, boolean state) {
|
||||
if (action instanceof PropertyOwner) {
|
||||
final String propertyName = ((PropertyOwner)action).getPropertyName();
|
||||
PropertiesComponent.getInstance().setValue(TreeStructureUtil.getPropertyName(propertyName), Boolean.toString(state));
|
||||
PropertiesComponent.getInstance().setValue(TreeStructureUtil.getPropertyName(propertyName), state);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2059,12 +2059,12 @@ public abstract class DialogWrapper {
|
||||
|
||||
@Override
|
||||
public boolean isToBeShown() {
|
||||
return PropertiesComponent.getInstance().getBoolean(myProperty, false);
|
||||
return PropertiesComponent.getInstance().getBoolean(myProperty);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setToBeShown(boolean value, int exitCode) {
|
||||
PropertiesComponent.getInstance().setValue(myProperty, Boolean.toString(value));
|
||||
PropertiesComponent.getInstance().setValue(myProperty, value);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -498,7 +498,7 @@ public class IdeFrameImpl extends JFrame implements IdeFrameEx, DataProvider {
|
||||
if (!WindowManager.getInstance().isFullScreenSupportedInCurrentOS()) return;
|
||||
|
||||
if (myProject != null) {
|
||||
PropertiesComponent.getInstance(myProject).setValue(FULL_SCREEN, String.valueOf(state));
|
||||
PropertiesComponent.getInstance(myProject).setValue(FULL_SCREEN, state);
|
||||
doLayout();
|
||||
}
|
||||
}
|
||||
@@ -506,7 +506,7 @@ public class IdeFrameImpl extends JFrame implements IdeFrameEx, DataProvider {
|
||||
public static boolean shouldRestoreFullScreen(@Nullable Project project) {
|
||||
return WindowManager.getInstance().isFullScreenSupportedInCurrentOS() &&
|
||||
project != null &&
|
||||
(SHOULD_OPEN_IN_FULL_SCREEN.get(project) == Boolean.TRUE || PropertiesComponent.getInstance(project).getBoolean(FULL_SCREEN, false));
|
||||
(SHOULD_OPEN_IN_FULL_SCREEN.get(project) == Boolean.TRUE || PropertiesComponent.getInstance(project).getBoolean(FULL_SCREEN));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -154,7 +154,7 @@ public class ColorPicker extends JPanel implements ColorListener, DocumentListen
|
||||
|
||||
setSize(300, 350);
|
||||
|
||||
final boolean hsb = PropertiesComponent.getInstance().getBoolean(HSB_PROPERTY, false);
|
||||
final boolean hsb = PropertiesComponent.getInstance().getBoolean(HSB_PROPERTY);
|
||||
if (hsb) {
|
||||
myFormat.setSelectedIndex(1);
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ public class ContentUtilEx extends ContentsUtil {
|
||||
}
|
||||
|
||||
public static void addTabbedContent(ContentManager manager, JComponent contentComponent, String groupPrefix, String tabName, boolean select, @Nullable Disposable childDisposable) {
|
||||
if (PropertiesComponent.getInstance().getBoolean(TabbedContent.SPLIT_PROPERTY_PREFIX + groupPrefix, false)) {
|
||||
if (PropertiesComponent.getInstance().getBoolean(TabbedContent.SPLIT_PROPERTY_PREFIX + groupPrefix)) {
|
||||
final Content content = ContentFactory.SERVICE.getInstance().createContent(contentComponent, groupPrefix + ": " + tabName, true);
|
||||
content.putUserData(Content.TABBED_CONTENT_KEY, Boolean.TRUE);
|
||||
content.putUserData(Content.TAB_GROUP_NAME_KEY, groupPrefix);
|
||||
|
||||
@@ -39,7 +39,7 @@ public class EditorConfigNotifierProvider extends EditorNotifications.Provider<E
|
||||
if (!(fileEditor instanceof TextEditor)) return null;
|
||||
final Project project = ((TextEditor)fileEditor).getEditor().getProject();
|
||||
final CodeStyleSettings settings = CodeStyleSettingsManager.getInstance(project).getCurrentSettings();
|
||||
if (!Utils.isEnabled(settings) || PropertiesComponent.getInstance(project).getBoolean(EDITOR_CONFIG_ACCEPTED, false)) return null;
|
||||
if (!Utils.isEnabled(settings) || PropertiesComponent.getInstance(project).getBoolean(EDITOR_CONFIG_ACCEPTED)) return null;
|
||||
|
||||
final List<EditorConfig.OutPair> pairs = SettingsProviderComponent.getInstance().getOutPairs(project, Utils.getFilePath(project, file));
|
||||
if (!pairs.isEmpty()) {
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
/*
|
||||
* Copyright 2000-2009 JetBrains s.r.o.
|
||||
* Copyright 2000-2015 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
|
||||
* 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
|
||||
* 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.
|
||||
* 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.tasks.actions;
|
||||
@@ -67,7 +67,7 @@ public class CloseTaskDialog extends DialogWrapper {
|
||||
myStateCombo.setVisible(false);
|
||||
}
|
||||
|
||||
final boolean stateUpdatesEnabled = PropertiesComponent.getInstance(myProject).getBoolean(UPDATE_STATE_ENABLED, false);
|
||||
final boolean stateUpdatesEnabled = PropertiesComponent.getInstance(myProject).getBoolean(UPDATE_STATE_ENABLED);
|
||||
myUpdateState.setSelected(stateUpdatesEnabled);
|
||||
myStateCombo.setEnabled(stateUpdatesEnabled);
|
||||
myUpdateState.addActionListener(new ActionListener() {
|
||||
|
||||
@@ -30,7 +30,7 @@ public class PyStudyInitialConfigurator {
|
||||
FileTypeManager fileTypeManager,
|
||||
final ProjectManagerEx projectManager) {
|
||||
final File file = new File(getCoursesRoot(), "Introduction to Python.zip");
|
||||
if (!propertiesComponent.getBoolean(CONFIGURED_V1, false)) {
|
||||
if (!propertiesComponent.getBoolean(CONFIGURED_V1)) {
|
||||
final File newCourses = new File(PathManager.getConfigPath(), "courses");
|
||||
try {
|
||||
FileUtil.createDirectory(newCourses);
|
||||
@@ -42,7 +42,7 @@ public class PyStudyInitialConfigurator {
|
||||
LOG.warn("Couldn't copy bundled courses " + e);
|
||||
}
|
||||
}
|
||||
if (!propertiesComponent.getBoolean(CONFIGURED_V11, false)) {
|
||||
if (!propertiesComponent.getBoolean(CONFIGURED_V11)) {
|
||||
final File newCourses = new File(PathManager.getConfigPath(), "courses");
|
||||
if (newCourses.exists()) {
|
||||
try {
|
||||
|
||||
@@ -136,13 +136,13 @@ public class PyCharmEduInitialConfigurator {
|
||||
FileTypeManager fileTypeManager,
|
||||
final ProjectManagerEx projectManager) {
|
||||
final UISettings uiSettings = UISettings.getInstance();
|
||||
if (!propertiesComponent.getBoolean(CONFIGURED_V1, false)) {
|
||||
if (!propertiesComponent.getBoolean(CONFIGURED_V1)) {
|
||||
patchMainMenu();
|
||||
uiSettings.SHOW_NAVIGATION_BAR = false;
|
||||
propertiesComponent.setValue(CONFIGURED_V1, "true");
|
||||
propertiesComponent.setValue(CONFIGURED_V1, true);
|
||||
}
|
||||
|
||||
if (!propertiesComponent.getBoolean(CONFIGURED, false)) {
|
||||
if (!propertiesComponent.getBoolean(CONFIGURED)) {
|
||||
propertiesComponent.setValue(CONFIGURED, "true");
|
||||
propertiesComponent.setValue("toolwindow.stripes.buttons.info.shown", "true");
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
* Copyright 2000-2015 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.
|
||||
@@ -41,18 +41,18 @@ public class PyCharmInitialConfigurator {
|
||||
@NonNls private static final String DISPLAYED_PROPERTY = "PyCharm.initialConfigurationShown";
|
||||
|
||||
public PyCharmInitialConfigurator(MessageBus bus, final PropertiesComponent propertiesComponent, final FileTypeManager fileTypeManager) {
|
||||
if (!propertiesComponent.getBoolean("PyCharm.InitialConfiguration", false)) {
|
||||
if (!propertiesComponent.getBoolean("PyCharm.InitialConfiguration")) {
|
||||
propertiesComponent.setValue("PyCharm.InitialConfiguration", "true");
|
||||
EditorSettingsExternalizable.getInstance().setVirtualSpace(false);
|
||||
}
|
||||
if (!propertiesComponent.getBoolean("PyCharm.InitialConfiguration.V2", false)) {
|
||||
propertiesComponent.setValue("PyCharm.InitialConfiguration.V2", "true");
|
||||
if (!propertiesComponent.getBoolean("PyCharm.InitialConfiguration.V2")) {
|
||||
propertiesComponent.setValue("PyCharm.InitialConfiguration.V2", true);
|
||||
final CodeStyleSettings settings = CodeStyleSettingsManager.getInstance().getCurrentSettings();
|
||||
settings.ALIGN_MULTILINE_PARAMETERS_IN_CALLS = true;
|
||||
settings.getCommonSettings(PythonLanguage.getInstance()).ALIGN_MULTILINE_PARAMETERS_IN_CALLS = true;
|
||||
UISettings.getInstance().SHOW_DIRECTORY_FOR_NON_UNIQUE_FILENAMES = true;
|
||||
}
|
||||
if (!propertiesComponent.getBoolean("PyCharm.InitialConfiguration.V3", false)) {
|
||||
if (!propertiesComponent.getBoolean("PyCharm.InitialConfiguration.V3")) {
|
||||
propertiesComponent.setValue("PyCharm.InitialConfiguration.V3", "true");
|
||||
UISettings.getInstance().SHOW_MEMORY_INDICATOR = false;
|
||||
final String ignoredFilesList = fileTypeManager.getIgnoredFilesList();
|
||||
@@ -68,12 +68,12 @@ public class PyCharmInitialConfigurator {
|
||||
}
|
||||
});
|
||||
}
|
||||
if (!propertiesComponent.getBoolean("PyCharm.InitialConfiguration.V4", false)) {
|
||||
propertiesComponent.setValue("PyCharm.InitialConfiguration.V4", "true");
|
||||
if (!propertiesComponent.getBoolean("PyCharm.InitialConfiguration.V4")) {
|
||||
propertiesComponent.setValue("PyCharm.InitialConfiguration.V4", true);
|
||||
PyCodeInsightSettings.getInstance().SHOW_IMPORT_POPUP = false;
|
||||
}
|
||||
if (!propertiesComponent.getBoolean("PyCharm.InitialConfiguration.V5", false)) {
|
||||
propertiesComponent.setValue("PyCharm.InitialConfiguration.V5", "true");
|
||||
if (!propertiesComponent.getBoolean("PyCharm.InitialConfiguration.V5")) {
|
||||
propertiesComponent.setValue("PyCharm.InitialConfiguration.V5", true);
|
||||
CodeInsightSettings.getInstance().REFORMAT_ON_PASTE = CodeInsightSettings.NO_REFORMAT;
|
||||
}
|
||||
if (!propertiesComponent.isValueSet(DISPLAYED_PROPERTY)) {
|
||||
|
||||
@@ -1,3 +1,18 @@
|
||||
/*
|
||||
* Copyright 2000-2015 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.jetbrains.python.refactoring.move;
|
||||
|
||||
import com.intellij.ide.util.PropertiesComponent;
|
||||
@@ -133,7 +148,7 @@ public class PyMoveModuleMembersDialog extends RefactoringDialog {
|
||||
}
|
||||
});
|
||||
mySeveralElementsSelected = elements.size() > 1;
|
||||
final boolean tableIsVisible = mySeveralElementsSelected || PropertiesComponent.getInstance().getBoolean(BULK_MOVE_TABLE_VISIBLE, false);
|
||||
final boolean tableIsVisible = mySeveralElementsSelected || PropertiesComponent.getInstance().getBoolean(BULK_MOVE_TABLE_VISIBLE);
|
||||
final String description;
|
||||
if (!tableIsVisible && elements.size() == 1) {
|
||||
if (firstElement instanceof PyFunction) {
|
||||
@@ -155,13 +170,13 @@ public class PyMoveModuleMembersDialog extends RefactoringDialog {
|
||||
protected void on() {
|
||||
super.on();
|
||||
myDescription.setText(PyBundle.message("refactoring.move.module.members.dialog.description.selection"));
|
||||
PropertiesComponent.getInstance().setValue(BULK_MOVE_TABLE_VISIBLE, "true");
|
||||
PropertiesComponent.getInstance().setValue(BULK_MOVE_TABLE_VISIBLE, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void off() {
|
||||
super.off();
|
||||
PropertiesComponent.getInstance().setValue(BULK_MOVE_TABLE_VISIBLE, "false");
|
||||
PropertiesComponent.getInstance().setValue(BULK_MOVE_TABLE_VISIBLE, false);
|
||||
}
|
||||
};
|
||||
decorator.setOn(tableIsVisible);
|
||||
@@ -184,7 +199,7 @@ public class PyMoveModuleMembersDialog extends RefactoringDialog {
|
||||
}
|
||||
|
||||
private void enlargeDialogHeightIfNecessary() {
|
||||
if (mySeveralElementsSelected && !PropertiesComponent.getInstance(getProject()).getBoolean(BULK_MOVE_TABLE_VISIBLE, false)) {
|
||||
if (mySeveralElementsSelected && !PropertiesComponent.getInstance(getProject()).getBoolean(BULK_MOVE_TABLE_VISIBLE)) {
|
||||
final DialogWrapperPeer peer = getPeer();
|
||||
final Dimension realSize = peer.getSize();
|
||||
final double preferredHeight = peer.getPreferredSize().getHeight();
|
||||
|
||||
@@ -31,8 +31,8 @@ public class DefaultHtmlDoctypeInitialConfigurator {
|
||||
|
||||
public DefaultHtmlDoctypeInitialConfigurator(ProjectManager projectManager,
|
||||
PropertiesComponent propertiesComponent) {
|
||||
if (!propertiesComponent.getBoolean("DefaultHtmlDoctype.MigrateToHtml5", false)) {
|
||||
propertiesComponent.setValue("DefaultHtmlDoctype.MigrateToHtml5", Boolean.TRUE.toString());
|
||||
if (!propertiesComponent.getBoolean("DefaultHtmlDoctype.MigrateToHtml5")) {
|
||||
propertiesComponent.setValue("DefaultHtmlDoctype.MigrateToHtml5", true);
|
||||
ExternalResourceManagerEx.getInstanceEx()
|
||||
.setDefaultHtmlDoctype(Html5SchemaProvider.getHtml5SchemaLocation(), projectManager.getDefaultProject());
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ public class HtmlFileStructureTest extends FileStructureTestBase {
|
||||
@Override
|
||||
public void setUp() throws Exception {
|
||||
super.setUp();
|
||||
myHtml5OutlineModeDefault = PropertiesComponent.getInstance().getBoolean(getHtml5OutlineModePropertyName(), false);
|
||||
myHtml5OutlineModeDefault = PropertiesComponent.getInstance().getBoolean(getHtml5OutlineModePropertyName());
|
||||
setHtml5OutlineMode(true);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
* Copyright 2000-2015 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.
|
||||
@@ -89,7 +89,7 @@ class HtmlFileTreeElement extends PsiTreeElementBase<XmlFile> {
|
||||
|
||||
if (myInStructureViewPopup) {
|
||||
final String propertyName = TreeStructureUtil.getPropertyName(Html5SectionsNodeProvider.HTML5_OUTLINE_PROVIDER_PROPERTY);
|
||||
if (PropertiesComponent.getInstance().getBoolean(propertyName, false)) {
|
||||
if (PropertiesComponent.getInstance().getBoolean(propertyName)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user