JavadocConfiguration — do not write defaults

This commit is contained in:
Vladimir Krivosheev
2018-01-16 16:17:32 +01:00
parent 787e678baa
commit 4d0972dc50
15 changed files with 138 additions and 186 deletions
@@ -1,17 +1,5 @@
/*
* Copyright 2000-2016 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.
* Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
*/
package com.intellij.openapi.roots.ui.configuration.projectRoot;
@@ -386,7 +374,7 @@ public abstract class BaseLibrariesConfigurable extends BaseStructureConfigurabl
final LibrariesModifiableModel libsModel = configurable.getModelProvider().getModifiableModel();
final Library lib = libsModel.createLibrary(newName, library.getKind());
final LibraryEx.ModifiableModelEx model = (LibraryEx.ModifiableModelEx)libsModel.getLibraryEditor(lib).getModel();
final LibraryEx.ModifiableModelEx model = libsModel.getLibraryEditor(lib).getModel();
LibraryEditingUtil.copyLibrary(library, Collections.emptyMap(), model);
}
}
@@ -1,17 +1,5 @@
/*
* 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.
* Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
*/
package com.intellij.openapi.roots.ui.configuration.projectRoot;
@@ -52,7 +40,6 @@ import java.util.*;
import java.util.List;
public abstract class BaseStructureConfigurable extends MasterDetailsComponent implements SearchableConfigurable, Disposable, Place.Navigator {
protected StructureConfigurableContext myContext;
protected final Project myProject;
@@ -68,7 +55,7 @@ public abstract class BaseStructureConfigurable extends MasterDetailsComponent i
myProject = project;
}
protected BaseStructureConfigurable(final Project project) {
protected BaseStructureConfigurable(@NotNull Project project) {
myProject = project;
}
@@ -239,7 +226,6 @@ public abstract class BaseStructureConfigurable extends MasterDetailsComponent i
}
}
@Override
public void reset() {
myUiDisposed = false;
@@ -286,7 +272,6 @@ public abstract class BaseStructureConfigurable extends MasterDetailsComponent i
result.add(new MyFindUsagesAction(myTree));
}
return result;
}
@@ -392,7 +377,6 @@ public abstract class BaseStructureConfigurable extends MasterDetailsComponent i
return objects;
}
protected void removeFacetNodes(@NotNull List<Facet> facets) {
for (Facet facet : facets) {
MyNode node = findNodeByObject(myRoot, facet);
@@ -403,7 +387,6 @@ public abstract class BaseStructureConfigurable extends MasterDetailsComponent i
}
protected abstract static class AbstractAddGroup extends ActionGroup implements ActionGroupWithPreselection {
protected AbstractAddGroup(String text, Icon icon) {
super(text, true);
@@ -1,17 +1,5 @@
/*
* 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.
* Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
*/
package com.intellij.javadoc;
@@ -19,6 +7,7 @@ import com.intellij.openapi.options.Configurable;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.projectRoots.Sdk;
import com.intellij.openapi.roots.JavadocOrderRootType;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.psi.PsiKeyword;
import javax.swing.*;
@@ -136,10 +125,7 @@ public final class JavadocConfigurable implements Configurable {
}
private static String convertString(String s) {
if (s != null && s.trim().length() == 0) {
return null;
}
return s;
return StringUtil.nullize(s, true);
}
private static String toSystemIndependentFormat(String directory) {
@@ -1,31 +1,15 @@
/*
* Copyright 2000-2016 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.
* Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
*/
package com.intellij.javadoc;
import com.intellij.psi.PsiKeyword;
import com.intellij.util.xmlb.SerializationFilter;
/**
* @author Eugene Zhuravlev
* @since Apr 24, 2004
*/
public class JavadocConfiguration {
public static final SerializationFilter FILTER = (accessor, bean) ->
!accessor.getName().equals("OPTION_LINK_TO_JDK_DOCS") || ((JavadocConfiguration)bean).OPTION_LINK_TO_JDK_DOCS;
public String OUTPUT_DIRECTORY;
public String OPTION_SCOPE = PsiKeyword.PROTECTED;
public boolean OPTION_HIERARCHY = true;
@@ -37,7 +21,7 @@ public class JavadocConfiguration {
public boolean OPTION_DOCUMENT_TAG_VERSION;
public boolean OPTION_DOCUMENT_TAG_DEPRECATED = true;
public boolean OPTION_DEPRECATED_LIST = true;
public String OTHER_OPTIONS = "";
public String OTHER_OPTIONS;
public String HEAP_SIZE;
public String LOCALE;
public boolean OPEN_IN_BROWSER = true;
@@ -1,17 +1,5 @@
/*
* Copyright 2000-2016 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.
* Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
*/
package com.intellij.javadoc;
@@ -25,13 +13,11 @@ import com.intellij.openapi.components.PersistentStateComponent;
import com.intellij.openapi.components.ServiceManager;
import com.intellij.openapi.components.State;
import com.intellij.openapi.project.Project;
import com.intellij.util.xmlb.XmlSerializer;
import org.jdom.Element;
import org.jetbrains.annotations.NotNull;
@State(name = "JavadocGenerationManager")
public final class JavadocGenerationManager implements PersistentStateComponent<Element> {
private final JavadocConfiguration myConfiguration = new JavadocConfiguration();
public final class JavadocGenerationManager implements PersistentStateComponent<JavadocConfiguration> {
private JavadocConfiguration myConfiguration = new JavadocConfiguration();
private final Project myProject;
public static JavadocGenerationManager getInstance(@NotNull Project project) {
@@ -43,13 +29,13 @@ public final class JavadocGenerationManager implements PersistentStateComponent<
}
@Override
public Element getState() {
return XmlSerializer.serialize(myConfiguration, JavadocConfiguration.FILTER);
public JavadocConfiguration getState() {
return myConfiguration;
}
@Override
public void loadState(Element state) {
XmlSerializer.deserializeInto(myConfiguration, state);
public void loadState(@NotNull JavadocConfiguration state) {
myConfiguration = state;
}
@NotNull
@@ -410,7 +410,7 @@ abstract class ComponentStoreImpl : IComponentStore {
return storages.sortByDeprecated()
}
override final fun isReloadPossible(componentNames: MutableSet<String>) = !componentNames.any { isNotReloadable(it) }
final override fun isReloadPossible(componentNames: MutableSet<String>) = !componentNames.any { isNotReloadable(it) }
private fun isNotReloadable(name: String): Boolean {
val component = components.get(name)?.component ?: return false
@@ -5,8 +5,11 @@ import com.intellij.openapi.application.ApplicationManager
import com.intellij.openapi.application.PathManager
import com.intellij.openapi.application.ex.PathManagerEx
import com.intellij.openapi.application.impl.ApplicationImpl
import com.intellij.openapi.components.impl.ComponentManagerImpl
import com.intellij.openapi.components.impl.ServiceManagerImpl
import com.intellij.openapi.components.impl.stores.StoreUtil
import com.intellij.openapi.components.stateStore
import com.intellij.openapi.project.impl.ProjectImpl
import com.intellij.openapi.util.io.FileUtil
import com.intellij.testFramework.ProjectRule
import com.intellij.testFramework.assertions.Assertions.assertThat
@@ -32,15 +35,22 @@ class DoNotSaveDefaultsTest {
}
@Test
fun test() {
val app = ApplicationManager.getApplication() as ApplicationImpl
val directory = app.stateStore.stateStorageManager.expandMacros(APP_CONFIG)
val dirPath = Paths.get(directory)
fun testApp() {
doTest(ApplicationManager.getApplication() as ApplicationImpl)
}
@Test
fun testProject() {
doTest(projectRule.project as ProjectImpl)
}
private fun doTest(componentManager: ComponentManagerImpl) {
val useModCountOldValue = System.getProperty("store.save.use.modificationCount")
// wake up
ServiceManagerImpl.processAllImplementationClasses(app, { clazz, pluginDescriptor ->
app.picoContainer.getComponentInstance(clazz.name)
val appPicoContainer = componentManager.picoContainer
ServiceManagerImpl.processAllImplementationClasses(componentManager, { clazz, _ ->
appPicoContainer.getComponentInstance(clazz.name)
true
})
@@ -49,11 +59,13 @@ class DoNotSaveDefaultsTest {
propertyComponent.unsetValue("file.gist.reindex.count")
// <property name="CommitChangeListDialog.DETAILS_SPLITTER_PROPORTION_2" value="1.0" />
propertyComponent.unsetValue("CommitChangeListDialog.DETAILS_SPLITTER_PROPORTION_2")
val app = ApplicationManager.getApplication() as ApplicationImpl
try {
System.setProperty("store.save.use.modificationCount", "false")
app.doNotSave(false)
runInEdtAndWait {
app.saveAll()
StoreUtil.save(componentManager.stateStore, null)
}
}
finally {
@@ -61,13 +73,13 @@ class DoNotSaveDefaultsTest {
app.doNotSave(true)
}
println(directory)
val directoryTree = printDirectoryTree(dirPath, setOf(
val directoryTree = printDirectoryTree(Paths.get(componentManager.stateStore.stateStorageManager.expandMacros(if (componentManager === app) APP_CONFIG else PROJECT_CONFIG_DIR)), setOf(
"path.macros.xml" /* todo EP to register (provide) macro dynamically */,
"stubIndex.xml" /* low-level non-roamable stuff */,
"usage.statistics.xml" /* SHOW_NOTIFICATION_ATTR in internal mode */,
"feature.usage.statistics.xml" /* non-roamable usage counters */,
"tomee.extensions.xml", "jboss.extensions.xml", "glassfish.extensions.xml" /* javaee non-roamable stuff, it will be better to fix it */,
"tomee.extensions.xml", "jboss.extensions.xml",
"glassfish.extensions.xml" /* javaee non-roamable stuff, it will be better to fix it */,
"dimensions.xml" /* non-roamable sizes of window, dialogs, etc. */,
"debugger.renderers.xml", "debugger.xml" /* todo */,
"databaseSettings.xml"
@@ -1,4 +1,6 @@
// Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
/*
* Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
*/
package com.intellij.packageDependencies;
import com.intellij.icons.AllIcons;
@@ -13,23 +15,27 @@ import com.intellij.openapi.wm.ToolWindowManager;
import com.intellij.openapi.wm.impl.content.ToolWindowContentUi;
import com.intellij.ui.content.Content;
import com.intellij.ui.content.ContentManager;
import org.jetbrains.annotations.NotNull;
/**
* @author yole
*/
public class DependenciesToolWindow {
public static DependenciesToolWindow getInstance(Project project) {
return ServiceManager.getService(project, DependenciesToolWindow.class);
}
private final Project myProject;
private ContentManager myContentManager;
public DependenciesToolWindow(final Project project) {
public static DependenciesToolWindow getInstance(@NotNull Project project) {
return ServiceManager.getService(project, DependenciesToolWindow.class);
}
public DependenciesToolWindow(@NotNull Project project) {
myProject = project;
StartupManager.getInstance(project).runWhenProjectIsInitialized(() -> {
final ToolWindowManager toolWindowManager = ToolWindowManager.getInstance(myProject);
if (toolWindowManager == null) return;
if (toolWindowManager == null) {
return;
}
ToolWindow toolWindow = toolWindowManager.registerToolWindow(ToolWindowId.DEPENDENCIES,
true,
ToolWindowAnchor.BOTTOM,
@@ -43,13 +49,12 @@ public class DependenciesToolWindow {
});
}
public void addContent(final Content content) {
final Runnable runnable = () -> {
public void addContent(@NotNull Content content) {
StartupManager.getInstance(myProject).runWhenProjectIsInitialized(() -> {
myContentManager.addContent(content);
myContentManager.setSelectedContent(content);
ToolWindowManager.getInstance(myProject).getToolWindow(ToolWindowId.DEPENDENCIES).activate(null);
};
StartupManager.getInstance(myProject).runWhenProjectIsInitialized(runnable);
});
}
public void closeContent(Content content) {
@@ -1,4 +1,6 @@
// Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
/*
* Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
*/
package com.intellij.openapi.wm;
import com.intellij.openapi.util.ActionCallback;
@@ -149,10 +151,8 @@ public interface ToolWindow extends BusyObject {
*/
JComponent getComponent();
ContentManager getContentManager();
void setDefaultState(@Nullable ToolWindowAnchor anchor, @Nullable ToolWindowType type, @Nullable Rectangle floatingBounds);
@@ -0,0 +1,40 @@
/*
* Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
*/
package com.intellij.openapi.updateSettings.impl
import com.intellij.openapi.components.BaseState
import com.intellij.util.xmlb.annotations.CollectionBean
import com.intellij.util.xmlb.annotations.OptionTag
internal class UpdateOptions : BaseState() {
@get:CollectionBean
val pluginHosts by list<String>()
@get:CollectionBean
val ignoredBuildNumbers by list<String>()
@get:CollectionBean
val enabledExternalComponentSources by list<String>()
@get:CollectionBean
val knownExternalComponentSources by list<String>()
@get:CollectionBean
val externalUpdateChannels by map<String, String>()
@get:OptionTag("CHECK_NEEDED")
var isCheckNeeded by property(false)
@get:OptionTag("LAST_TIME_CHECKED")
var lastTimeChecked by property(0L)
@get:OptionTag("LAST_BUILD_CHECKED")
var lastBuildChecked by string()
@get:OptionTag("UPDATE_CHANNEL_TYPE")
var updateChannelType by string(ChannelStatus.RELEASE.code)
@get:OptionTag("SECURE_CONNECTION")
var isUseSecureConnection by property(true)
}
@@ -1,17 +1,5 @@
/*
* 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.
* Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
*/
package com.intellij.openapi.updateSettings.impl;
@@ -19,16 +7,12 @@ import com.intellij.openapi.application.ApplicationInfo;
import com.intellij.openapi.application.PathManager;
import com.intellij.openapi.components.*;
import com.intellij.openapi.updateSettings.UpdateStrategyCustomization;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.util.SmartList;
import com.intellij.util.containers.ContainerUtil;
import com.intellij.util.net.NetUtils;
import com.intellij.util.xmlb.annotations.CollectionBean;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@@ -41,29 +25,13 @@ import java.util.stream.Stream;
@Storage(value = "other.xml", deprecated = true)
}
)
public class UpdateSettings implements PersistentStateComponent<UpdateSettings.State>, UserUpdateSettings {
public static class State {
@CollectionBean public final List<String> pluginHosts = new SmartList<>();
@CollectionBean public final List<String> ignoredBuildNumbers = new SmartList<>();
@CollectionBean public final List<String> enabledExternalComponentSources = new SmartList<>();
@CollectionBean public final List<String> knownExternalComponentSources = new SmartList<>();
@CollectionBean public final Map<String, String> externalUpdateChannels = new HashMap<>();
public boolean CHECK_NEEDED = true;
public long LAST_TIME_CHECKED = 0;
public String LAST_BUILD_CHECKED;
public String UPDATE_CHANNEL_TYPE = ChannelStatus.RELEASE.getCode();
public boolean SECURE_CONNECTION = true;
}
public class UpdateSettings implements PersistentStateComponent<UpdateOptions>, UserUpdateSettings {
public static UpdateSettings getInstance() {
return ServiceManager.getService(UpdateSettings.class);
}
private final String myPackageManager = System.getProperty("ide.no.platform.update");
private State myState = new State();
private UpdateOptions myState = new UpdateOptions();
public boolean isPlatformUpdateEnabled() {
return myPackageManager == null && !PathManager.isSnap();
@@ -71,72 +39,71 @@ public class UpdateSettings implements PersistentStateComponent<UpdateSettings.S
@NotNull
@Override
public State getState() {
public UpdateOptions getState() {
return myState;
}
@Override
public void loadState(@NotNull State state) {
public void loadState(@NotNull UpdateOptions state) {
myState = state;
myState.LAST_BUILD_CHECKED = StringUtil.nullize(myState.LAST_BUILD_CHECKED);
}
@Nullable
public String getLastBuildChecked() {
return myState.LAST_BUILD_CHECKED;
return myState.getLastBuildChecked();
}
@NotNull
public List<String> getStoredPluginHosts() {
return myState.pluginHosts;
return myState.getPluginHosts();
}
public boolean isCheckNeeded() {
return myState.CHECK_NEEDED;
return myState.isCheckNeeded();
}
public void setCheckNeeded(boolean value) {
myState.CHECK_NEEDED = value;
myState.setCheckNeeded(value);
}
public List<String> getEnabledExternalUpdateSources() {
return myState.enabledExternalComponentSources;
return myState.getEnabledExternalComponentSources();
}
public List<String> getKnownExternalUpdateSources() {
return myState.knownExternalComponentSources;
return myState.getKnownExternalComponentSources();
}
public Map<String, String> getExternalUpdateChannels() {
return myState.externalUpdateChannels;
return myState.getExternalUpdateChannels();
}
public boolean isSecureConnection() {
return myState.SECURE_CONNECTION;
return myState.isUseSecureConnection();
}
public void setSecureConnection(boolean value) {
myState.SECURE_CONNECTION = value;
myState.setUseSecureConnection(value);
}
public long getLastTimeChecked() {
return myState.LAST_TIME_CHECKED;
return myState.getLastTimeChecked();
}
@NotNull
@Override
public List<String> getIgnoredBuildNumbers() {
return myState.ignoredBuildNumbers;
return myState.getIgnoredBuildNumbers();
}
@NotNull
@Override
public ChannelStatus getSelectedChannelStatus() {
return ChannelStatus.fromCode(myState.UPDATE_CHANNEL_TYPE);
return ChannelStatus.fromCode(myState.getUpdateChannelType());
}
public void setSelectedChannelStatus(@NotNull ChannelStatus channel) {
myState.UPDATE_CHANNEL_TYPE = channel.getCode();
myState.setUpdateChannelType(channel.getCode());
}
@NotNull
@@ -156,8 +123,9 @@ public class UpdateSettings implements PersistentStateComponent<UpdateSettings.S
: getActiveChannels().stream().filter(ch -> ch.compareTo(current) > 0).findFirst().orElse(ChannelStatus.RELEASE);
}
@NotNull
public List<String> getPluginHosts() {
List<String> hosts = new ArrayList<>(myState.pluginHosts);
List<String> hosts = new ArrayList<>(myState.getPluginHosts());
String pluginHosts = System.getProperty("idea.plugin.hosts");
if (pluginHosts != null) {
ContainerUtil.addAll(hosts, pluginHosts.split(";"));
@@ -166,29 +134,29 @@ public class UpdateSettings implements PersistentStateComponent<UpdateSettings.S
}
public void forceCheckForUpdateAfterRestart() {
myState.LAST_TIME_CHECKED = 0;
myState.setLastTimeChecked(0);
}
public void saveLastCheckedInfo() {
myState.LAST_TIME_CHECKED = System.currentTimeMillis();
myState.LAST_BUILD_CHECKED = ApplicationInfo.getInstance().getBuild().asString();
myState.setLastTimeChecked(System.currentTimeMillis());
myState.setLastBuildChecked(ApplicationInfo.getInstance().getBuild().asString());
}
public boolean canUseSecureConnection() {
return myState.SECURE_CONNECTION && NetUtils.isSniEnabled();
return myState.isUseSecureConnection() && NetUtils.isSniEnabled();
}
//<editor-fold desc="Deprecated stuff.">
/** @deprecated use {@link #getSelectedChannelStatus()} (to be removed in IDEA 2018) */
@SuppressWarnings("unused")
public String getUpdateChannelType() {
return myState.UPDATE_CHANNEL_TYPE;
return myState.getUpdateChannelType();
}
/** @deprecated use {@link #setSelectedChannelStatus(ChannelStatus)} (to be removed in IDEA 2018) */
@SuppressWarnings("unused")
public void setUpdateChannelType(@NotNull String value) {
myState.UPDATE_CHANNEL_TYPE = value;
myState.setUpdateChannelType(value);
}
//</editor-fold>
}
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
* Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
*/
package com.intellij.openapi.wm.impl
@@ -37,8 +37,7 @@ class ProjectFrameBounds(private val project: Project) : PersistentStateComponen
}
override fun getModificationCount(): Long {
val windowManager = WindowManager.getInstance() as WindowManagerImpl
val frameInfoInDeviceSpace = windowManager.getFrameInfoInDeviceSpace(project)
val frameInfoInDeviceSpace = (WindowManager.getInstance() as? WindowManagerImpl)?.getFrameInfoInDeviceSpace(project)
if (frameInfoInDeviceSpace != null) {
if (rawFrameInfo == null) {
rawFrameInfo = frameInfoInDeviceSpace
@@ -78,10 +77,10 @@ fun WindowManagerImpl.getFrameInfoInDeviceSpace(project: Project): FrameInfo? {
return frameInfo
}
private val X_ATTR = "x"
private val Y_ATTR = "y"
private val WIDTH_ATTR = "width"
private val HEIGHT_ATTR = "height"
private const val X_ATTR = "x"
private const val Y_ATTR = "y"
private const val WIDTH_ATTR = "width"
private const val HEIGHT_ATTR = "height"
fun serializeBounds(bounds: Rectangle, element: Element) {
element.setAttribute(X_ATTR, Integer.toString(bounds.x))
@@ -1,7 +1,6 @@
/*
* Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
* Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
*/
package com.intellij.openapi.wm.impl;
import com.intellij.openapi.Disposable;
@@ -406,7 +405,7 @@ public class ToolWindowHeadlessManagerImpl extends ToolWindowManagerEx {
@Override
public JComponent getComponent() {
return null;
return new JLabel();
}
@Override
+1 -2
View File
@@ -109,8 +109,7 @@
<projectService serviceInterface="com.intellij.codeInsight.documentation.DocumentationManager"
serviceImplementation="com.jetbrains.python.PyDocumentationManager" overrides="true"/>
<applicationService serviceInterface="com.jetbrains.python.sdk.PySdkSettings"
serviceImplementation="com.jetbrains.python.sdk.PySdkSettings"/>
<applicationService serviceImplementation="com.jetbrains.python.sdk.PySdkSettings"/>
<applicationService serviceInterface="com.jetbrains.python.packaging.PyPackageService"
serviceImplementation="com.jetbrains.python.packaging.PyPackageService"/>
<applicationService serviceInterface="com.jetbrains.python.packaging.PyCondaPackageService"
@@ -1,4 +1,6 @@
// Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
/*
* Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
*/
package com.jetbrains.python.sdk
import com.intellij.application.options.ReplacePathToMacroMap
@@ -18,7 +20,8 @@ import org.jetbrains.jps.model.serialization.PathMacroUtil
class PySdkSettings : PersistentStateComponent<PySdkSettings.State> {
companion object {
@JvmStatic
val instance: PySdkSettings = ServiceManager.getService(PySdkSettings::class.java)
val instance: PySdkSettings
get() = ServiceManager.getService(PySdkSettings::class.java)
private const val VIRTUALENV_ROOT_DIR_MACRO_NAME = "VIRTUALENV_ROOT_DIR"
}