mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
don't write default value of property
This commit is contained in:
+8
-26
@@ -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.
|
||||
@@ -22,7 +22,6 @@
|
||||
*/
|
||||
package com.intellij.openapi.roots.ui.configuration;
|
||||
|
||||
import com.intellij.ide.util.PropertiesComponent;
|
||||
import com.intellij.openapi.actionSystem.AnAction;
|
||||
import com.intellij.openapi.actionSystem.DefaultActionGroup;
|
||||
import com.intellij.openapi.options.ConfigurationException;
|
||||
@@ -37,9 +36,9 @@ import com.intellij.openapi.roots.ui.configuration.projectRoot.ProjectSdksModel;
|
||||
import com.intellij.openapi.ui.MasterDetailsComponent;
|
||||
import com.intellij.openapi.ui.MasterDetailsStateService;
|
||||
import com.intellij.openapi.ui.NamedConfigurable;
|
||||
import com.intellij.openapi.ui.Splitter;
|
||||
import com.intellij.openapi.util.Conditions;
|
||||
import com.intellij.openapi.util.Ref;
|
||||
import com.intellij.ui.JBSplitter;
|
||||
import com.intellij.ui.TreeSpeedSearch;
|
||||
import com.intellij.util.Consumer;
|
||||
import com.intellij.util.IconUtil;
|
||||
@@ -53,11 +52,8 @@ import java.awt.*;
|
||||
import java.util.*;
|
||||
|
||||
public class ProjectJdksConfigurable extends MasterDetailsComponent {
|
||||
|
||||
private final ProjectSdksModel myProjectJdksModel;
|
||||
private final Project myProject;
|
||||
@NonNls
|
||||
private static final String SPLITTER_PROPORTION = "project.jdk.splitter";
|
||||
|
||||
public ProjectJdksConfigurable(Project project) {
|
||||
this(project, ProjectStructureConfigurable.getInstance(project).getProjectJdksModel());
|
||||
@@ -107,27 +103,17 @@ public class ProjectJdksConfigurable extends MasterDetailsComponent {
|
||||
addNode(new MyNode(configurable), myRoot);
|
||||
}
|
||||
selectJdk(myProjectJdksModel.getProjectSdk()); //restore selection
|
||||
final String value = PropertiesComponent.getInstance().getValue(SPLITTER_PROPORTION);
|
||||
if (value != null) {
|
||||
try {
|
||||
final Splitter splitter = extractSplitter();
|
||||
if (splitter != null) {
|
||||
(splitter).setProportion(Float.parseFloat(value));
|
||||
}
|
||||
}
|
||||
catch (NumberFormatException e) {
|
||||
//do not set proportion
|
||||
}
|
||||
|
||||
JBSplitter splitter = extractSplitter();
|
||||
if (splitter != null) {
|
||||
splitter.setAndLoadSplitterProportionKey("project.jdk.splitter");
|
||||
}
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private Splitter extractSplitter() {
|
||||
private JBSplitter extractSplitter() {
|
||||
final Component[] components = myWholePanel.getComponents();
|
||||
if (components.length == 1 && components[0] instanceof Splitter) {
|
||||
return (Splitter)components[0];
|
||||
}
|
||||
return null;
|
||||
return components.length == 1 && components[0] instanceof JBSplitter ? (JBSplitter)components[0] : null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -170,10 +156,6 @@ public class ProjectJdksConfigurable extends MasterDetailsComponent {
|
||||
|
||||
@Override
|
||||
public void disposeUIResources() {
|
||||
final Splitter splitter = extractSplitter();
|
||||
if (splitter != null) {
|
||||
PropertiesComponent.getInstance().setValue(SPLITTER_PROPORTION, String.valueOf(splitter.getProportion()));
|
||||
}
|
||||
myProjectJdksModel.disposeUIResources();
|
||||
super.disposeUIResources();
|
||||
}
|
||||
|
||||
@@ -180,6 +180,7 @@ public class UnscrambleDialog extends DialogWrapper {
|
||||
return selectedUnscrambler;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static List<String> getSavedLogFileUrls() {
|
||||
final List<String> res = new ArrayList<String>();
|
||||
final String savedUrl = PropertiesComponent.getInstance().getValue(PROPERTY_LOG_FILE_HISTORY_URLS);
|
||||
@@ -254,21 +255,16 @@ public class UnscrambleDialog extends DialogWrapper {
|
||||
public void dispose() {
|
||||
if (isOK()){
|
||||
final List<String> list = myLogFile.getHistory();
|
||||
PropertiesComponent.getInstance().setValue(PROPERTY_LOG_FILE_HISTORY_URLS, StringUtil.join(list, ":::"));
|
||||
PropertiesComponent.getInstance().setValue(PROPERTY_LOG_FILE_HISTORY_URLS, list.isEmpty() ? null : StringUtil.join(list, ":::"), null);
|
||||
UnscrambleSupport selectedUnscrambler = getSelectedUnscrambler();
|
||||
saveProperty(PROPERTY_UNSCRAMBLER_NAME_USED, selectedUnscrambler == null ? null : selectedUnscrambler.getPresentableName());
|
||||
|
||||
saveProperty(PROPERTY_LOG_FILE_LAST_URL, myLogFile.getText());
|
||||
PropertiesComponent.getInstance().setValue(PROPERTY_UNSCRAMBLER_NAME_USED, selectedUnscrambler == null ? null : selectedUnscrambler.getPresentableName(), null);
|
||||
PropertiesComponent.getInstance().setValue(PROPERTY_LOG_FILE_LAST_URL, StringUtil.nullize(myLogFile.getText()), null);
|
||||
}
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
private void saveProperty(String name, String value) {
|
||||
PropertiesComponent.getInstance().setValue(name, value);
|
||||
PropertiesComponent.getInstance(myProject).setValue(name, value);
|
||||
}
|
||||
|
||||
private String getPropertyValue(String name) {
|
||||
@Nullable
|
||||
private String getPropertyValue(@NotNull String name) {
|
||||
String projectValue = PropertiesComponent.getInstance(myProject).getValue(name);
|
||||
if (projectValue != null) {
|
||||
return projectValue;
|
||||
@@ -294,7 +290,6 @@ public class UnscrambleDialog extends DialogWrapper {
|
||||
String text = myStacktraceEditorPanel.getText();
|
||||
myStacktraceEditorPanel.setText(normalizeText(text));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static String normalizeText(@NonNls String text) {
|
||||
|
||||
@@ -20,6 +20,7 @@ import com.intellij.execution.configurations.ConfigurationType;
|
||||
import com.intellij.execution.configurations.UnknownConfigurationType;
|
||||
import com.intellij.execution.junit.JUnitConfigurationType;
|
||||
import com.intellij.ide.util.PropertiesComponent;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.InvalidDataException;
|
||||
import com.intellij.openapi.util.JDOMUtil;
|
||||
import com.intellij.openapi.util.Trinity;
|
||||
@@ -196,7 +197,8 @@ public class RunConfigurableTest extends LightIdeaTestCase {
|
||||
}
|
||||
|
||||
private static RunManagerImpl createRunManager(Element element) throws InvalidDataException {
|
||||
RunManagerImpl runManager = new RunManagerImpl(getProject(), PropertiesComponent.getInstance());
|
||||
Project project = getProject();
|
||||
RunManagerImpl runManager = new RunManagerImpl(project, PropertiesComponent.getInstance(project));
|
||||
runManager.initializeConfigurationTypes(new ConfigurationType[]{ApplicationConfigurationType.getInstance(),
|
||||
JUnitConfigurationType.getInstance(), UnknownConfigurationType.INSTANCE});
|
||||
runManager.loadState(element);
|
||||
|
||||
@@ -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.
|
||||
@@ -17,6 +17,7 @@ package com.intellij.ide.util;
|
||||
|
||||
import com.intellij.openapi.components.ServiceManager;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.text.StringUtilRt;
|
||||
import com.intellij.util.ObjectUtils;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -25,6 +26,10 @@ import org.jetbrains.annotations.Nullable;
|
||||
import java.lang.reflect.Field;
|
||||
|
||||
/**
|
||||
* Roaming is disabled for PropertiesComponent, so, use it only and only for temporary non-roamable properties.
|
||||
*
|
||||
* See http://www.jetbrains.org/intellij/sdk/docs/basics/persisting_state_of_components.html "Using PropertiesComponent for Simple non-roamable Persistence"
|
||||
*
|
||||
* @author max
|
||||
* @author Konstantin Bulenkov
|
||||
*/
|
||||
@@ -36,12 +41,25 @@ public abstract class PropertiesComponent {
|
||||
@Nullable
|
||||
public abstract String getValue(@NonNls String name);
|
||||
|
||||
public abstract void setValue(@NonNls String name, String value);
|
||||
/**
|
||||
* @deprecated Use {@link #setValue(String, String, String)} to avoid write defaults.
|
||||
*/
|
||||
public abstract void setValue(@NotNull String name, String value);
|
||||
|
||||
/**
|
||||
* Set value or unset if equals to default value
|
||||
*/
|
||||
public abstract void setValue(@NotNull String name, @NotNull String value, @NotNull String defaultValue);
|
||||
public abstract void setValue(@NotNull String name, @Nullable String value, @Nullable String defaultValue);
|
||||
|
||||
/**
|
||||
* Set value or unset if equals to default value
|
||||
*/
|
||||
public abstract void setValue(@NotNull String name, float value, float defaultValue);
|
||||
|
||||
/**
|
||||
* Set value or unset if equals to default value
|
||||
*/
|
||||
public abstract void setValue(@NotNull String name, int value, int defaultValue);
|
||||
|
||||
@Nullable
|
||||
public abstract String[] getValues(@NonNls String name);
|
||||
@@ -73,11 +91,7 @@ public abstract class PropertiesComponent {
|
||||
}
|
||||
|
||||
public final int getOrInitInt(@NonNls String name, int defaultValue) {
|
||||
try {
|
||||
return Integer.parseInt(getValue(name));
|
||||
} catch (NumberFormatException e) {
|
||||
return defaultValue;
|
||||
}
|
||||
return StringUtilRt.parseInt(name, defaultValue);
|
||||
}
|
||||
|
||||
public final long getOrInitLong(@NonNls String name, long defaultValue) {
|
||||
|
||||
@@ -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,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));
|
||||
PropertiesComponent.getInstance().setValue(POWER_SAVE_MODE, String.valueOf(value), "false");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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.
|
||||
@@ -76,8 +76,8 @@ public class PropertiesComponentImpl extends PropertiesComponent implements Pers
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setValue(@NotNull String name, @NotNull String value, @NotNull String defaultValue) {
|
||||
if (value.equals(defaultValue)) {
|
||||
public void setValue(@NotNull String name, @Nullable String value, @Nullable String defaultValue) {
|
||||
if (value == null || value.equals(defaultValue)) {
|
||||
myMap.remove(name);
|
||||
}
|
||||
else {
|
||||
@@ -85,6 +85,26 @@ public class PropertiesComponentImpl extends PropertiesComponent implements Pers
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setValue(@NotNull String name, float value, float defaultValue) {
|
||||
if (value == defaultValue) {
|
||||
myMap.remove(name);
|
||||
}
|
||||
else {
|
||||
myMap.put(name, String.valueOf(value));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setValue(@NotNull String name, int value, int defaultValue) {
|
||||
if (value == defaultValue) {
|
||||
myMap.remove(name);
|
||||
}
|
||||
else {
|
||||
myMap.put(name, String.valueOf(value));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unsetValue(String name) {
|
||||
myMap.remove(name);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* 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.
|
||||
@@ -16,37 +16,32 @@
|
||||
|
||||
package com.intellij.execution;
|
||||
|
||||
import com.intellij.execution.impl.RunManagerImpl;
|
||||
import com.intellij.execution.util.StoringPropertyContainer;
|
||||
import com.intellij.ide.util.PropertiesComponent;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
|
||||
public class RunManagerConfig {
|
||||
public static final String MAKE = ExecutionBundle.message("before.run.property.make");
|
||||
private final StoringPropertyContainer myProperties;
|
||||
private final PropertiesComponent myPropertiesComponent;
|
||||
|
||||
public static final int MIN_RECENT_LIMIT = 0;
|
||||
public static final int DEFAULT_RECENT_LIMIT = 5;
|
||||
|
||||
private final PropertiesComponent myPropertiesComponent;
|
||||
|
||||
@NonNls private static final String RECENTS_LIMIT = "recentsLimit";
|
||||
@NonNls private static final String RESTART_REQUIRES_CONFIRMATION = "restartRequiresConfirmation";
|
||||
@NonNls private static final String STOP_INCOMPATIBLE_REQUIRES_CONFIRMATION = "stopIncompatibleRequiresConfirmation";
|
||||
|
||||
public RunManagerConfig(PropertiesComponent propertiesComponent,
|
||||
RunManagerImpl manager) {
|
||||
public RunManagerConfig(PropertiesComponent propertiesComponent) {
|
||||
myPropertiesComponent = propertiesComponent;
|
||||
myProperties = new StoringPropertyContainer("RunManagerConfig.", propertiesComponent);
|
||||
}
|
||||
|
||||
public int getRecentsLimit() {
|
||||
try {
|
||||
return Math.max(MIN_RECENT_LIMIT, Integer.valueOf(myPropertiesComponent.getOrInit(RECENTS_LIMIT, "5")).intValue());
|
||||
}
|
||||
catch (NumberFormatException e) {
|
||||
return 5;
|
||||
}
|
||||
return Math.max(MIN_RECENT_LIMIT, StringUtil.parseInt(myPropertiesComponent.getValue(RECENTS_LIMIT), DEFAULT_RECENT_LIMIT));
|
||||
}
|
||||
|
||||
public void setRecentsLimit(int recentsLimit) {
|
||||
myPropertiesComponent.setValue(RECENTS_LIMIT, Integer.toString(recentsLimit));
|
||||
myPropertiesComponent.setValue(RECENTS_LIMIT, recentsLimit, DEFAULT_RECENT_LIMIT);
|
||||
}
|
||||
|
||||
public boolean isRestartRequiresConfirmation() {
|
||||
@@ -54,7 +49,7 @@ public class RunManagerConfig {
|
||||
}
|
||||
|
||||
public void setRestartRequiresConfirmation(boolean restartRequiresConfirmation) {
|
||||
myPropertiesComponent.setValue(RESTART_REQUIRES_CONFIRMATION, String.valueOf(restartRequiresConfirmation));
|
||||
myPropertiesComponent.setValue(RESTART_REQUIRES_CONFIRMATION, String.valueOf(restartRequiresConfirmation), "true");
|
||||
}
|
||||
|
||||
public boolean isStopIncompatibleRequiresConfirmation() {
|
||||
|
||||
@@ -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.
|
||||
@@ -28,7 +28,6 @@ import com.intellij.openapi.extensions.Extensions;
|
||||
import com.intellij.openapi.options.*;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.ui.Messages;
|
||||
import com.intellij.openapi.ui.Splitter;
|
||||
import com.intellij.openapi.ui.popup.JBPopupFactory;
|
||||
import com.intellij.openapi.ui.popup.ListPopup;
|
||||
import com.intellij.openapi.ui.popup.ListPopupStep;
|
||||
@@ -45,7 +44,6 @@ import com.intellij.ui.treeStructure.Tree;
|
||||
import com.intellij.util.ArrayUtilRt;
|
||||
import com.intellij.util.IconUtil;
|
||||
import com.intellij.util.PlatformIcons;
|
||||
import com.intellij.util.config.StorageAccessors;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import com.intellij.util.containers.Convertor;
|
||||
import com.intellij.util.containers.HashMap;
|
||||
@@ -78,7 +76,7 @@ class RunConfigurable extends BaseConfigurable {
|
||||
private static final Icon REMOVE_ICON = IconUtil.getRemoveIcon();
|
||||
private static final Icon SHARED_ICON = AllIcons.Nodes.Shared;
|
||||
private static final Icon NON_SHARED_ICON = EmptyIcon.ICON_16;
|
||||
@NonNls private static final String DIVIDER_PROPORTION = "dividerProportion";
|
||||
|
||||
@NonNls private static final Object DEFAULTS = new Object() {
|
||||
@Override
|
||||
public String toString() {
|
||||
@@ -94,9 +92,8 @@ class RunConfigurable extends BaseConfigurable {
|
||||
final MyTreeModel myTreeModel = new MyTreeModel(myRoot);
|
||||
final Tree myTree = new Tree(myTreeModel);
|
||||
private final JPanel myRightPanel = new JPanel(new BorderLayout());
|
||||
private final Splitter mySplitter = new Splitter(false);
|
||||
private final JBSplitter mySplitter = new JBSplitter("RunConfigurable.dividerProportion", 0.3f);
|
||||
private JPanel myWholePanel;
|
||||
private final StorageAccessors myProperties = StorageAccessors.createGlobal("RunConfigurable");
|
||||
private Configurable mySelectedConfigurable = null;
|
||||
private static final Logger LOG = Logger.getInstance("#com.intellij.execution.impl.RunConfigurable");
|
||||
private final JTextField myRecentsLimit = new JTextField("5", 2);
|
||||
@@ -614,6 +611,7 @@ class RunConfigurable extends BaseConfigurable {
|
||||
}
|
||||
|
||||
myWholePanel = new JPanel(new BorderLayout());
|
||||
|
||||
mySplitter.setFirstComponent(createLeftPanel());
|
||||
mySplitter.setSecondComponent(myRightPanel);
|
||||
myWholePanel.add(mySplitter, BorderLayout.CENTER);
|
||||
@@ -625,8 +623,6 @@ class RunConfigurable extends BaseConfigurable {
|
||||
d.height = Math.max(d.height, 600);
|
||||
myWholePanel.setPreferredSize(d);
|
||||
|
||||
mySplitter.setProportion(myProperties.getFloat(DIVIDER_PROPORTION, 0.3f));
|
||||
|
||||
return myWholePanel;
|
||||
}
|
||||
|
||||
@@ -908,7 +904,6 @@ class RunConfigurable extends BaseConfigurable {
|
||||
}
|
||||
});
|
||||
myRightPanel.removeAll();
|
||||
myProperties.setFloat(DIVIDER_PROPORTION, mySplitter.getProportion());
|
||||
mySplitter.dispose();
|
||||
}
|
||||
|
||||
|
||||
@@ -95,9 +95,8 @@ public class RunManagerImpl extends RunManagerEx implements PersistentStateCompo
|
||||
|
||||
private final EventDispatcher<RunManagerListener> myDispatcher = EventDispatcher.create(RunManagerListener.class);
|
||||
|
||||
public RunManagerImpl(final Project project,
|
||||
PropertiesComponent propertiesComponent) {
|
||||
myConfig = new RunManagerConfig(propertiesComponent, this);
|
||||
public RunManagerImpl(@NotNull Project project, @NotNull PropertiesComponent propertiesComponent) {
|
||||
myConfig = new RunManagerConfig(propertiesComponent);
|
||||
myProject = project;
|
||||
|
||||
initializeConfigurationTypes(ConfigurationType.CONFIGURATION_TYPE_EP.getExtensions());
|
||||
|
||||
+1
-1
@@ -646,7 +646,7 @@ public class AllFileTemplatesConfigurable implements SearchableConfigurable, Con
|
||||
public void disposeUIResources() {
|
||||
if (myCurrentTab != null) {
|
||||
final PropertiesComponent propertiesComponent = PropertiesComponent.getInstance();
|
||||
propertiesComponent.setValue(CURRENT_TAB, myCurrentTab.getTitle());
|
||||
propertiesComponent.setValue(CURRENT_TAB, myCurrentTab.getTitle(), TEMPLATES_TITLE);
|
||||
final FileTemplate template = myCurrentTab.getSelectedTemplate();
|
||||
if (template != null) {
|
||||
propertiesComponent.setValue(SELECTED_TEMPLATE, template.getName());
|
||||
|
||||
+8
-12
@@ -41,7 +41,6 @@ import com.intellij.openapi.editor.markup.TextAttributes;
|
||||
import com.intellij.openapi.options.ConfigurationException;
|
||||
import com.intellij.openapi.project.DumbAwareAction;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.ui.Splitter;
|
||||
import com.intellij.openapi.util.Comparing;
|
||||
import com.intellij.openapi.util.Disposer;
|
||||
import com.intellij.openapi.util.JDOMUtil;
|
||||
@@ -65,7 +64,6 @@ import com.intellij.ui.*;
|
||||
import com.intellij.ui.components.JBLabel;
|
||||
import com.intellij.util.Alarm;
|
||||
import com.intellij.util.Function;
|
||||
import com.intellij.util.config.StorageAccessors;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import com.intellij.util.containers.Convertor;
|
||||
import com.intellij.util.containers.Queue;
|
||||
@@ -105,13 +103,13 @@ public class SingleInspectionProfilePanel extends JPanel {
|
||||
@NonNls private static final String INSPECTION_FILTER_HISTORY = "INSPECTION_FILTER_HISTORY";
|
||||
private static final String UNDER_CONSTRUCTION = InspectionsBundle.message("inspection.tool.description.under.construction.text");
|
||||
@NonNls private static final String EMPTY_HTML = "<html><body></body></html>";
|
||||
@NonNls private static final String VERTICAL_DIVIDER_PROPORTION = "VERTICAL_DIVIDER_PROPORTION";
|
||||
@NonNls private static final String HORIZONTAL_DIVIDER_PROPORTION = "HORIZONTAL_DIVIDER_PROPORTION";
|
||||
|
||||
private static final float DIVIDER_PROPORTION_DEFAULT = 0.5f;
|
||||
|
||||
private final List<ToolDescriptors> myInitialToolDescriptors = new ArrayList<ToolDescriptors>();
|
||||
private final InspectionConfigTreeNode myRoot =
|
||||
new InspectionConfigTreeNode(InspectionsBundle.message("inspection.root.node.title"));
|
||||
private final Alarm myAlarm = new Alarm();
|
||||
private final StorageAccessors myProperties = StorageAccessors.createGlobal("SingleInspectionProfilePanel");
|
||||
private final InspectionProjectProfileManager myProjectProfileManager;
|
||||
@NotNull private Profile myOriginal;
|
||||
private InspectionProfileImpl mySelectedProfile;
|
||||
@@ -132,8 +130,8 @@ public class SingleInspectionProfilePanel extends JPanel {
|
||||
private String myCurrentProfileName;
|
||||
private boolean myIsInRestore = false;
|
||||
private boolean myShareProfile;
|
||||
private Splitter myRightSplitter;
|
||||
private Splitter myMainSplitter;
|
||||
private JBSplitter myRightSplitter;
|
||||
private JBSplitter myMainSplitter;
|
||||
|
||||
private String[] myInitialScopesOrder;
|
||||
private Disposable myDisposable = new Disposable() {
|
||||
@@ -1056,8 +1054,6 @@ public class SingleInspectionProfilePanel extends JPanel {
|
||||
if (myInspectionProfilePanel == null) {
|
||||
return;
|
||||
}
|
||||
myProperties.setFloat(VERTICAL_DIVIDER_PROPORTION, myMainSplitter.getProportion());
|
||||
myProperties.setFloat(HORIZONTAL_DIVIDER_PROPORTION, myRightSplitter.getProportion());
|
||||
myAlarm.cancelAllRequests();
|
||||
myProfileFilter.dispose();
|
||||
if (mySelectedProfile != null) {
|
||||
@@ -1085,9 +1081,8 @@ public class SingleInspectionProfilePanel extends JPanel {
|
||||
new Insets(2, 0, 0, 0)));
|
||||
descriptionPanel.add(ScrollPaneFactory.createScrollPane(myBrowser), BorderLayout.CENTER);
|
||||
|
||||
myRightSplitter = new Splitter(true);
|
||||
myRightSplitter = new JBSplitter(true, "SingleInspectionProfilePanel.HORIZONTAL_DIVIDER_PROPORTION", DIVIDER_PROPORTION_DEFAULT);
|
||||
myRightSplitter.setFirstComponent(descriptionPanel);
|
||||
myRightSplitter.setProportion(myProperties.getFloat(HORIZONTAL_DIVIDER_PROPORTION, 0.5f));
|
||||
|
||||
myOptionsPanel = new JPanel(new GridBagLayout());
|
||||
initOptionsAndDescriptionPanel();
|
||||
@@ -1102,7 +1097,8 @@ public class SingleInspectionProfilePanel extends JPanel {
|
||||
northPanel.add(myProfileFilter, new GridBagConstraints(0, 0, 1, 1, 0.5, 1, GridBagConstraints.BASELINE_TRAILING, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));
|
||||
northPanel.add(createTreeToolbarPanel().getComponent(), new GridBagConstraints(1, 0, 1, 1, 1, 1, GridBagConstraints.BASELINE_LEADING, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));
|
||||
|
||||
myMainSplitter = new Splitter(false, myProperties.getFloat(VERTICAL_DIVIDER_PROPORTION, 0.5f), 0.01f, 0.99f);
|
||||
myMainSplitter = new JBSplitter(false, DIVIDER_PROPORTION_DEFAULT, 0.01f, 0.99f);
|
||||
myMainSplitter.setSplitterProportionKey("SingleInspectionProfilePanel.VERTICAL_DIVIDER_PROPORTION");
|
||||
myMainSplitter.setFirstComponent(tree);
|
||||
myMainSplitter.setSecondComponent(myRightSplitter);
|
||||
myMainSplitter.setHonorComponentsMinimumSize(false);
|
||||
|
||||
+1
-1
@@ -131,7 +131,7 @@ public class ModuleRunConfigurationManagerTest extends LightPlatformTestCase {
|
||||
|
||||
private final class MyRunManagerImpl extends RunManagerImpl {
|
||||
public MyRunManagerImpl() {
|
||||
super(LightPlatformTestCase.getProject(), PropertiesComponent.getInstance());
|
||||
super(LightPlatformTestCase.getProject(), PropertiesComponent.getInstance(LightPlatformTestCase.getProject()));
|
||||
}
|
||||
|
||||
@NotNull
|
||||
|
||||
@@ -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,25 +33,47 @@ public class JBSplitter extends Splitter {
|
||||
*/
|
||||
@Nullable
|
||||
private String mySplitterProportionKey = null;
|
||||
private final float myDefaultProportion;
|
||||
|
||||
public JBSplitter() {
|
||||
super();
|
||||
|
||||
myDefaultProportion = 0.5f;
|
||||
}
|
||||
|
||||
public JBSplitter(@NotNull String proportionKey, float defaultProportion) {
|
||||
this(false, proportionKey, defaultProportion);
|
||||
}
|
||||
|
||||
public JBSplitter(boolean vertical, @NotNull String proportionKey, float defaultProportion) {
|
||||
super(vertical, defaultProportion);
|
||||
|
||||
mySplitterProportionKey = proportionKey;
|
||||
myDefaultProportion = defaultProportion;
|
||||
}
|
||||
|
||||
public JBSplitter(boolean vertical) {
|
||||
super(vertical);
|
||||
|
||||
myDefaultProportion = 0.5f;
|
||||
}
|
||||
|
||||
public JBSplitter(boolean vertical, float proportion) {
|
||||
super(vertical, proportion);
|
||||
|
||||
myDefaultProportion = proportion;
|
||||
}
|
||||
|
||||
public JBSplitter(float proportion) {
|
||||
super(false, proportion);
|
||||
|
||||
myDefaultProportion = proportion;
|
||||
}
|
||||
|
||||
public JBSplitter(boolean vertical, float proportion, float minProp, float maxProp) {
|
||||
super(vertical, proportion, minProp, maxProp);
|
||||
|
||||
myDefaultProportion = proportion;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -95,14 +117,14 @@ public class JBSplitter extends Splitter {
|
||||
}
|
||||
|
||||
protected void loadProportion() {
|
||||
if (! StringUtil.isEmpty(mySplitterProportionKey)) {
|
||||
if (!StringUtil.isEmpty(mySplitterProportionKey)) {
|
||||
setProportion(PropertiesComponent.getInstance().getFloat(mySplitterProportionKey, myProportion));
|
||||
}
|
||||
}
|
||||
|
||||
protected void saveProportion() {
|
||||
if (! StringUtil.isEmpty(mySplitterProportionKey)) {
|
||||
PropertiesComponent.getInstance().setValue(mySplitterProportionKey, String.valueOf(myProportion));
|
||||
if (!StringUtil.isEmpty(mySplitterProportionKey)) {
|
||||
PropertiesComponent.getInstance().setValue(mySplitterProportionKey, myProportion, myDefaultProportion);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ package com.intellij.ui;
|
||||
import com.intellij.openapi.ui.Divider;
|
||||
import com.intellij.openapi.ui.OnePixelDivider;
|
||||
import com.intellij.util.Producer;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.awt.*;
|
||||
|
||||
@@ -42,6 +43,12 @@ public class OnePixelSplitter extends JBSplitter {
|
||||
init();
|
||||
}
|
||||
|
||||
public OnePixelSplitter(@NotNull String proportionKey, float defaultProportion) {
|
||||
super(proportionKey, defaultProportion);
|
||||
|
||||
init();
|
||||
}
|
||||
|
||||
public OnePixelSplitter(float proportion) {
|
||||
super(proportion);
|
||||
init();
|
||||
|
||||
@@ -24,6 +24,11 @@ import java.util.Collections;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
|
||||
@Deprecated
|
||||
/**
|
||||
* @deprecated Use {@link PropertiesComponent} directly.
|
||||
* @see {@link JBSplitter}
|
||||
*/
|
||||
public interface Storage {
|
||||
void put(String key, String value);
|
||||
String get(String key);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* 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.
|
||||
@@ -15,12 +15,17 @@
|
||||
*/
|
||||
package com.intellij.util.config;
|
||||
|
||||
import com.intellij.ide.util.PropertiesComponent;
|
||||
import com.intellij.openapi.application.Application;
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
@Deprecated
|
||||
/**
|
||||
* @author dyoma
|
||||
* @deprecated Use {@link PropertiesComponent} directly.
|
||||
* @see {@link JBSplitter}
|
||||
*/
|
||||
public class StorageAccessors {
|
||||
private final Storage myStorage;
|
||||
@@ -29,12 +34,10 @@ public class StorageAccessors {
|
||||
myStorage = storage;
|
||||
}
|
||||
|
||||
public static StorageAccessors createGlobal(@NonNls String prefix) {
|
||||
@NotNull
|
||||
public static StorageAccessors createGlobal(@NotNull @NonNls String prefix) {
|
||||
Application application = ApplicationManager.getApplication();
|
||||
Storage storage;
|
||||
if (application != null) storage = new Storage.PropertiesComponentStorage(prefix + ".");
|
||||
else storage = new Storage.MapStorage();
|
||||
return new StorageAccessors(storage);
|
||||
return new StorageAccessors(application == null ? new Storage.MapStorage() : new Storage.PropertiesComponentStorage(prefix + "."));
|
||||
}
|
||||
|
||||
public float getFloat(@NonNls String id, float defaultValue) {
|
||||
|
||||
+3
-3
@@ -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.
|
||||
@@ -99,7 +99,7 @@ public class ChooseComponentsToExportDialog extends DialogWrapper {
|
||||
|
||||
myPathPanel = new FieldPanel(IdeBundle.message("editbox.export.settings.to"), null, browseAction, null);
|
||||
|
||||
String exportPath = PropertiesComponent.getInstance().getOrInit("export.settings.path", DEFAULT_PATH);
|
||||
String exportPath = PropertiesComponent.getInstance().getValue("export.settings.path", DEFAULT_PATH);
|
||||
myPathPanel.setText(exportPath);
|
||||
myPathPanel.setChangeListener(new Runnable() {
|
||||
@Override
|
||||
@@ -143,7 +143,7 @@ public class ChooseComponentsToExportDialog extends DialogWrapper {
|
||||
|
||||
@Override
|
||||
protected void doOKAction() {
|
||||
PropertiesComponent.getInstance().setValue("export.settings.path", myPathPanel.getText());
|
||||
PropertiesComponent.getInstance().setValue("export.settings.path", myPathPanel.getText(), DEFAULT_PATH);
|
||||
super.doOKAction();
|
||||
}
|
||||
|
||||
|
||||
+6
-3
@@ -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.
|
||||
@@ -35,6 +35,7 @@ import com.intellij.openapi.fileEditor.FileEditorManager;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.Condition;
|
||||
import com.intellij.openapi.util.Key;
|
||||
import com.intellij.openapi.util.text.StringUtilRt;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.ui.content.Content;
|
||||
import com.intellij.util.Consumer;
|
||||
@@ -48,6 +49,8 @@ import javax.swing.*;
|
||||
*/
|
||||
public class AutoTestManager {
|
||||
private static final String AUTO_TEST_MANAGER_DELAY = "auto.test.manager.delay";
|
||||
private static final int AUTO_TEST_MANAGER_DELAY_DEFAULT = 3000;
|
||||
|
||||
private static final Key<ProcessListener> ON_TERMINATION_RESTARTER_KEY = Key.create("auto.test.manager.on.termination.restarter");
|
||||
private static final Key<ExecutionEnvironment> EXECUTION_ENVIRONMENT_KEY = Key.create("auto.test.manager.execution.environment");
|
||||
|
||||
@@ -62,7 +65,7 @@ public class AutoTestManager {
|
||||
|
||||
public AutoTestManager(@NotNull Project project) {
|
||||
myProject = project;
|
||||
myDelayMillis = PropertiesComponent.getInstance(project).getOrInitInt(AUTO_TEST_MANAGER_DELAY, 3000);
|
||||
myDelayMillis = StringUtilRt.parseInt(PropertiesComponent.getInstance(project).getValue(AUTO_TEST_MANAGER_DELAY), AUTO_TEST_MANAGER_DELAY_DEFAULT);
|
||||
myDocumentWatcher = createWatcher();
|
||||
}
|
||||
|
||||
@@ -226,6 +229,6 @@ public class AutoTestManager {
|
||||
if (hasEnabledAutoTests()) {
|
||||
myDocumentWatcher.activate();
|
||||
}
|
||||
PropertiesComponent.getInstance(myProject).setValue(AUTO_TEST_MANAGER_DELAY, String.valueOf(myDelayMillis));
|
||||
PropertiesComponent.getInstance(myProject).setValue(AUTO_TEST_MANAGER_DELAY, myDelayMillis, AUTO_TEST_MANAGER_DELAY_DEFAULT);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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.
|
||||
@@ -27,8 +27,8 @@ import com.intellij.openapi.ui.Messages;
|
||||
import com.intellij.openapi.ui.Splitter;
|
||||
import com.intellij.openapi.util.Factory;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.ui.JBSplitter;
|
||||
import com.intellij.util.config.AbstractProperty;
|
||||
import com.intellij.util.config.StorageAccessors;
|
||||
import com.intellij.util.containers.HashMap;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
@@ -93,8 +93,7 @@ public class AntSetPanel {
|
||||
}
|
||||
|
||||
private static class Form implements AntUIUtil.PropertiesEditor<AntInstallation> {
|
||||
private final Splitter mySplitter = new Splitter(false);
|
||||
private final StorageAccessors myAccessors = StorageAccessors.createGlobal("antConfigurations");
|
||||
private final Splitter mySplitter = new JBSplitter("antConfigurations.splitter", 03f);
|
||||
private final RightPanel myRightPanel;
|
||||
private final AnActionListEditor<AntInstallation> myAnts = new AnActionListEditor<AntInstallation>();
|
||||
private final UIPropertyBinding.Composite myBinding = new UIPropertyBinding.Composite();
|
||||
@@ -110,7 +109,6 @@ public class AntSetPanel {
|
||||
};
|
||||
|
||||
public Form(final GlobalAntConfiguration antInstallation) {
|
||||
mySplitter.setProportion(myAccessors.getFloat("splitter", 0.3f));
|
||||
mySplitter.setShowDividerControls(true);
|
||||
mySplitter.setFirstComponent(myAnts);
|
||||
myGlobalWorkingProperties = new EditPropertyContainer(antInstallation.getProperties());
|
||||
|
||||
+5
-3
@@ -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.
|
||||
@@ -45,7 +45,9 @@ import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.util.*;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class UpdateCopyrightAction extends BaseAnalysisAction {
|
||||
public static final String UPDATE_EXISTING_COPYRIGHTS = "update.existing.copyrights";
|
||||
@@ -131,7 +133,7 @@ public class UpdateCopyrightAction extends BaseAnalysisAction {
|
||||
|
||||
@Override
|
||||
protected void analyze(@NotNull final Project project, @NotNull final AnalysisScope scope) {
|
||||
PropertiesComponent.getInstance().setValue(UPDATE_EXISTING_COPYRIGHTS, String.valueOf(myUpdateExistingCopyrightsCb.isSelected()));
|
||||
PropertiesComponent.getInstance().setValue(UPDATE_EXISTING_COPYRIGHTS, String.valueOf(myUpdateExistingCopyrightsCb.isSelected()), "true");
|
||||
final Map<PsiFile, Runnable> preparations = new LinkedHashMap<PsiFile, Runnable>();
|
||||
Task.Backgroundable task = new Task.Backgroundable(project, "Prepare Copyright...", true) {
|
||||
@Override
|
||||
|
||||
+17
-12
@@ -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 org.intellij.lang.xpath.xslt.associations.impl;
|
||||
|
||||
import com.intellij.ide.projectView.ProjectViewNode;
|
||||
@@ -15,7 +30,6 @@ import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.progress.ProgressIndicator;
|
||||
import com.intellij.openapi.progress.Progressive;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.ui.Splitter;
|
||||
import com.intellij.openapi.util.Disposer;
|
||||
import com.intellij.psi.PsiFile;
|
||||
import com.intellij.ui.*;
|
||||
@@ -23,12 +37,10 @@ import com.intellij.ui.components.JBList;
|
||||
import com.intellij.ui.components.JBScrollPane;
|
||||
import com.intellij.ui.treeStructure.Tree;
|
||||
import com.intellij.util.IconUtil;
|
||||
import com.intellij.util.config.StorageAccessors;
|
||||
import com.intellij.util.ui.UIUtil;
|
||||
import icons.XpathIcons;
|
||||
import org.intellij.lang.xpath.xslt.XsltSupport;
|
||||
import org.intellij.lang.xpath.xslt.associations.FileAssociationsManager;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@@ -46,13 +58,10 @@ import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
class AssociationsEditor {
|
||||
@NonNls private static final String DIVIDER_PROPORTION = "dividerProportion";
|
||||
|
||||
private JPanel myComponent;
|
||||
private JBList myList;
|
||||
private Tree myTree;
|
||||
private Splitter mySplitter;
|
||||
private final StorageAccessors myProperties = StorageAccessors.createGlobal("AssociationsEditor");
|
||||
private JBSplitter mySplitter;
|
||||
|
||||
private final AssociationsModel myListModel;
|
||||
private final TransactionalManager myManager;
|
||||
@@ -109,7 +118,7 @@ class AssociationsEditor {
|
||||
|
||||
private void initUI() {
|
||||
myComponent = new JPanel(new BorderLayout());
|
||||
mySplitter = new Splitter(false, 0.3f);
|
||||
mySplitter = new JBSplitter("AssociationsEditor.dividerProportion", 0.3f);
|
||||
myComponent.add(mySplitter, BorderLayout.CENTER);
|
||||
|
||||
JPanel leftPanel = new JPanel(new BorderLayout());
|
||||
@@ -130,9 +139,6 @@ class AssociationsEditor {
|
||||
.disableUpDownActions().disableAddAction().disableRemoveAction().createPanel();
|
||||
UIUtil.addBorder(rightPanel, IdeBorderFactory.createTitledBorder("Associated Files", false, new Insets(0, 0, 0, 0)));
|
||||
mySplitter.setSecondComponent(rightPanel);
|
||||
|
||||
final float dividerProportion = myProperties.getFloat(DIVIDER_PROPORTION, 0.3f);
|
||||
mySplitter.setProportion(dividerProportion);
|
||||
}
|
||||
|
||||
private void expandTree(DefaultTreeModel newModel) {
|
||||
@@ -191,7 +197,6 @@ class AssociationsEditor {
|
||||
}
|
||||
|
||||
public void dispose() {
|
||||
myProperties.setFloat(DIVIDER_PROPORTION, mySplitter.getProportion());
|
||||
Disposer.dispose(myBuilder);
|
||||
myManager.dispose();
|
||||
}
|
||||
|
||||
@@ -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.
|
||||
@@ -138,7 +138,7 @@ public class PyIdeCommonOptionsForm implements AbstractPyCommonOptionsForm {
|
||||
storeState();
|
||||
}
|
||||
private void storeState() {
|
||||
PropertiesComponent.getInstance().setValue(EXPAND_PROPERTY_KEY, String.valueOf(isExpanded()));
|
||||
PropertiesComponent.getInstance().setValue(EXPAND_PROPERTY_KEY, String.valueOf(isExpanded()), "true");
|
||||
}
|
||||
};
|
||||
myDecorator.setOn(PropertiesComponent.getInstance().getBoolean(EXPAND_PROPERTY_KEY, 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.
|
||||
@@ -15,6 +15,7 @@
|
||||
*/
|
||||
package com.jetbrains.python.run;
|
||||
|
||||
import com.intellij.application.options.ModulesComboBox;
|
||||
import com.intellij.execution.configuration.EnvironmentVariablesComponent;
|
||||
import com.intellij.execution.util.PathMappingsComponent;
|
||||
import com.intellij.ide.util.PropertiesComponent;
|
||||
@@ -26,7 +27,6 @@ import com.intellij.openapi.projectRoots.impl.SdkListCellRenderer;
|
||||
import com.intellij.openapi.roots.ModuleRootManager;
|
||||
import com.intellij.openapi.roots.ProjectRootManager;
|
||||
import com.intellij.openapi.roots.ui.configuration.ModulesAlphaComparator;
|
||||
import com.intellij.application.options.ModulesComboBox;
|
||||
import com.intellij.openapi.ui.TextFieldWithBrowseButton;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.ui.CollectionComboBoxModel;
|
||||
@@ -110,7 +110,7 @@ public class PyPluginCommonOptionsForm implements AbstractPyCommonOptionsForm {
|
||||
storeState();
|
||||
}
|
||||
private void storeState() {
|
||||
PropertiesComponent.getInstance().setValue(EXPAND_PROPERTY_KEY, String.valueOf(isExpanded()));
|
||||
PropertiesComponent.getInstance().setValue(EXPAND_PROPERTY_KEY, String.valueOf(isExpanded()), "true");
|
||||
}
|
||||
};
|
||||
myDecorator.setOn(PropertiesComponent.getInstance().getBoolean(EXPAND_PROPERTY_KEY, true));
|
||||
|
||||
@@ -1,7 +1,23 @@
|
||||
/*
|
||||
* 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.javaee;
|
||||
|
||||
import com.intellij.ide.util.PropertiesComponent;
|
||||
import com.intellij.openapi.project.ProjectManager;
|
||||
import com.intellij.openapi.util.text.StringUtilRt;
|
||||
import com.intellij.openapi.vfs.VfsUtilCore;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.openapi.vfs.VirtualFileManager;
|
||||
@@ -21,7 +37,7 @@ public class DefaultHtmlDoctypeInitialConfigurator {
|
||||
.setDefaultHtmlDoctype(Html5SchemaProvider.getHtml5SchemaLocation(), projectManager.getDefaultProject());
|
||||
}
|
||||
// sometimes VFS fails to pick up updated schema contents and we need to force refresh
|
||||
if (propertiesComponent.getOrInitInt("DefaultHtmlDoctype.Refreshed", 0) < VERSION) {
|
||||
if (StringUtilRt.parseInt(propertiesComponent.getValue("DefaultHtmlDoctype.Refreshed"), 0) < VERSION) {
|
||||
propertiesComponent.setValue("DefaultHtmlDoctype.Refreshed", Integer.toString(VERSION));
|
||||
final String schemaUrl = VfsUtilCore.pathToUrl(Html5SchemaProvider.getHtml5SchemaLocation());
|
||||
final VirtualFile schemaFile = VirtualFileManager.getInstance().findFileByUrl(schemaUrl);
|
||||
|
||||
Reference in New Issue
Block a user