[vcs-log] cleanup RootCellRenderer

GitOrigin-RevId: bba216626193ac756cd133b8ae9bc4e577abea42
This commit is contained in:
Julia Beliaeva
2019-06-09 22:19:30 +03:00
committed by intellij-monorepo-bot
parent dcaeb8f8c7
commit 3fee046d20
2634 changed files with 86405 additions and 51566 deletions

View File

@@ -1,5 +1,5 @@
<component name="ArtifactManager">
<artifact type="jar" name="maven-event-listener">
<artifact type="jar" build-on-make="true" name="maven-event-listener">
<output-path>$PROJECT_DIR$/out/artifacts/maven_event_listener</output-path>
<root id="archive" name="maven-event-listener.jar">
<element id="module-output" name="intellij.maven.server.eventListener" />

View File

@@ -46,5 +46,10 @@
<option name="name" value="7f849d18-5038-490f-a93d-226871e8f98c" />
<option name="url" value="https://cache-redirector.jetbrains.com/www.myget.org/F/rd-snapshots/maven" />
</remote-repository>
<remote-repository>
<option name="id" value="e585af2a-f558-424b-a8e6-3a1365d5b046" />
<option name="name" value="e585af2a-f558-424b-a8e6-3a1365d5b046" />
<option name="url" value="https://cache-redirector.jetbrains.com/jetbrains.bintray.com/markdown" />
</remote-repository>
</component>
</project>

View File

@@ -1,12 +1,12 @@
<component name="libraryTable">
<library name="Groovy" type="repository">
<properties maven-id="org.codehaus.groovy:groovy-all:2.4.15" />
<properties maven-id="org.codehaus.groovy:groovy-all:2.4.17" />
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/codehaus/groovy/groovy-all/2.4.15/groovy-all-2.4.15.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/codehaus/groovy/groovy-all/2.4.17/groovy-all-2.4.17.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/org/codehaus/groovy/groovy-all/2.4.15/groovy-all-2.4.15-sources.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/codehaus/groovy/groovy-all/2.4.17/groovy-all-2.4.17-sources.jar!/" />
</SOURCES>
</library>
</component>

View File

@@ -1,10 +0,0 @@
<component name="libraryTable">
<library name="Groovy-Eclipse-Batch" type="repository">
<properties maven-id="org.codehaus.groovy:groovy-eclipse-batch:2.4.15-01" />
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/codehaus/groovy/groovy-eclipse-batch/2.4.15-01/groovy-eclipse-batch-2.4.15-01.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View File

@@ -1,31 +1,48 @@
<component name="libraryTable">
<library name="batik-transcoder" type="repository">
<properties maven-id="org.jetbrains.intellij.deps.batik:batik-transcoder:1.12.0-3">
<properties maven-id="org.jetbrains.intellij.deps.batik:batik-transcoder:1.12.0-8">
<exclude>
<dependency maven-id="org.apache.xmlgraphics:xmlgraphics-commons" />
<dependency maven-id="commons-io:commons-io" />
<dependency maven-id="commons-logging:commons-logging" />
<dependency maven-id="xalan:xalan" />
<dependency maven-id="xml-apis:xml-apis" />
<dependency maven-id="xml-apis:xml-apis-ext" />
</exclude>
</properties>
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/jetbrains/intellij/deps/batik/batik-transcoder/1.12.0-3/batik-transcoder-1.12.0-3.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/jetbrains/intellij/deps/batik/batik-awt-util/1.12.0-3/batik-awt-util-1.12.0-3.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/jetbrains/intellij/deps/batik/batik-bridge/1.12.0-3/batik-bridge-1.12.0-3.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/jetbrains/intellij/deps/batik/batik-anim/1.12.0-3/batik-anim-1.12.0-3.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/jetbrains/intellij/deps/batik/batik-css/1.12.0-3/batik-css-1.12.0-3.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/jetbrains/intellij/deps/batik/batik-parser/1.12.0-3/batik-parser-1.12.0-3.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/jetbrains/intellij/deps/batik/batik-svg-dom/1.12.0-3/batik-svg-dom-1.12.0-3.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/jetbrains/intellij/deps/batik/batik-dom/1.12.0-3/batik-dom-1.12.0-3.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/jetbrains/intellij/deps/batik/batik-ext/1.12.0-3/batik-ext-1.12.0-3.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/jetbrains/intellij/deps/batik/batik-gvt/1.12.0-3/batik-gvt-1.12.0-3.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/jetbrains/intellij/deps/batik/batik-svggen/1.12.0-3/batik-svggen-1.12.0-3.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/jetbrains/intellij/deps/batik/batik-util/1.12.0-3/batik-util-1.12.0-3.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/jetbrains/intellij/deps/batik/batik-constants/1.12.0-3/batik-constants-1.12.0-3.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/jetbrains/intellij/deps/batik/batik-i18n/1.12.0-3/batik-i18n-1.12.0-3.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/jetbrains/intellij/deps/batik/batik-xml/1.12.0-3/batik-xml-1.12.0-3.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/jetbrains/intellij/deps/batik/batik-transcoder/1.12.0-8/batik-transcoder-1.12.0-8.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/jetbrains/intellij/deps/batik/batik-awt-util/1.12.0-8/batik-awt-util-1.12.0-8.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/apache/xmlgraphics/xmlgraphics-commons/2.3/xmlgraphics-commons-2.3.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/jetbrains/intellij/deps/batik/batik-bridge/1.12.0-8/batik-bridge-1.12.0-8.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/jetbrains/intellij/deps/batik/batik-anim/1.12.0-8/batik-anim-1.12.0-8.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/jetbrains/intellij/deps/batik/batik-parser/1.12.0-8/batik-parser-1.12.0-8.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/jetbrains/intellij/deps/batik/batik-svg-dom/1.12.0-8/batik-svg-dom-1.12.0-8.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/jetbrains/intellij/deps/batik/batik-dom/1.12.0-8/batik-dom-1.12.0-8.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/jetbrains/intellij/deps/batik/batik-css/1.12.0-8/batik-css-1.12.0-8.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/jetbrains/intellij/deps/batik/batik-ext/1.12.0-8/batik-ext-1.12.0-8.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/jetbrains/intellij/deps/batik/batik-gvt/1.12.0-8/batik-gvt-1.12.0-8.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/jetbrains/intellij/deps/batik/batik-svggen/1.12.0-8/batik-svggen-1.12.0-8.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/jetbrains/intellij/deps/batik/batik-util/1.12.0-8/batik-util-1.12.0-8.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/jetbrains/intellij/deps/batik/batik-constants/1.12.0-8/batik-constants-1.12.0-8.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/jetbrains/intellij/deps/batik/batik-xml/1.12.0-8/batik-xml-1.12.0-8.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/org/jetbrains/intellij/deps/batik/batik-transcoder/1.12.0-8/batik-transcoder-1.12.0-8-sources.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/jetbrains/intellij/deps/batik/batik-awt-util/1.12.0-8/batik-awt-util-1.12.0-8-sources.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/apache/xmlgraphics/xmlgraphics-commons/2.3/xmlgraphics-commons-2.3-sources.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/jetbrains/intellij/deps/batik/batik-bridge/1.12.0-8/batik-bridge-1.12.0-8-sources.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/jetbrains/intellij/deps/batik/batik-anim/1.12.0-8/batik-anim-1.12.0-8-sources.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/jetbrains/intellij/deps/batik/batik-parser/1.12.0-8/batik-parser-1.12.0-8-sources.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/jetbrains/intellij/deps/batik/batik-svg-dom/1.12.0-8/batik-svg-dom-1.12.0-8-sources.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/jetbrains/intellij/deps/batik/batik-dom/1.12.0-8/batik-dom-1.12.0-8-sources.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/jetbrains/intellij/deps/batik/batik-css/1.12.0-8/batik-css-1.12.0-8-sources.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/jetbrains/intellij/deps/batik/batik-ext/1.12.0-8/batik-ext-1.12.0-8-sources.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/jetbrains/intellij/deps/batik/batik-gvt/1.12.0-8/batik-gvt-1.12.0-8-sources.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/jetbrains/intellij/deps/batik/batik-svggen/1.12.0-8/batik-svggen-1.12.0-8-sources.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/jetbrains/intellij/deps/batik/batik-util/1.12.0-8/batik-util-1.12.0-8-sources.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/jetbrains/intellij/deps/batik/batik-constants/1.12.0-8/batik-constants-1.12.0-8-sources.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/jetbrains/intellij/deps/batik/batik-xml/1.12.0-8/batik-xml-1.12.0-8-sources.jar!/" />
</SOURCES>
</library>
</component>

View File

@@ -1,12 +1,12 @@
<component name="libraryTable">
<library name="com.android.tools:sdk-common" type="repository">
<properties include-transitive-deps="false" maven-id="com.android.tools:sdk-common:26.3.0" />
<properties include-transitive-deps="false" maven-id="org.jetbrains.intellij.deps.android.tools:sdk-common:26.3.0-sp1" />
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/com/android/tools/sdk-common/26.3.0/sdk-common-26.3.0.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/jetbrains/intellij/deps/android/tools/sdk-common/26.3.0-sp1/sdk-common-26.3.0-sp1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/com/android/tools/sdk-common/26.3.0/sdk-common-26.3.0-sources.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/jetbrains/intellij/deps/android/tools/sdk-common/26.3.0-sp1/sdk-common-26.3.0-sp1-sources.jar!/" />
</SOURCES>
</library>
</component>

View File

@@ -1,15 +1,15 @@
<component name="libraryTable">
<library name="ion" type="repository">
<properties maven-id="com.amazon.ion:ion-java:1.4.0" />
<properties maven-id="org.jetbrains.intellij.deps:ion-java:1.5.0-1" />
<ANNOTATIONS>
<root url="file://$PROJECT_DIR$/lib/annotations/ion" />
</ANNOTATIONS>
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/com/amazon/ion/ion-java/1.4.0/ion-java-1.4.0.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/jetbrains/intellij/deps/ion-java/1.5.0-1/ion-java-1.5.0-1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/com/amazon/ion/ion-java/1.4.0/ion-java-1.4.0-sources.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/jetbrains/intellij/deps/ion-java/1.5.0-1/ion-java-1.5.0-1-sources.jar!/" />
</SOURCES>
</library>
</component>

View File

@@ -1,12 +1,12 @@
<component name="libraryTable">
<library name="jediterm-pty" type="repository">
<properties include-transitive-deps="false" maven-id="org.jetbrains.jediterm:jediterm-pty:2.15" />
<properties include-transitive-deps="false" maven-id="org.jetbrains.jediterm:jediterm-pty:2.16" />
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/jetbrains/jediterm/jediterm-pty/2.15/jediterm-pty-2.15.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/jetbrains/jediterm/jediterm-pty/2.16/jediterm-pty-2.16.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/org/jetbrains/jediterm/jediterm-pty/2.15/jediterm-pty-2.15-sources.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/jetbrains/jediterm/jediterm-pty/2.16/jediterm-pty-2.16-sources.jar!/" />
</SOURCES>
</library>
</component>

View File

@@ -1,6 +1,6 @@
<component name="libraryTable">
<library name="pty4j" type="repository">
<properties maven-id="org.jetbrains.pty4j:pty4j:0.9.3">
<properties maven-id="org.jetbrains.pty4j:pty4j:0.9.4">
<exclude>
<dependency maven-id="org.jetbrains:annotations" />
<dependency maven-id="com.google.guava:guava" />
@@ -10,12 +10,12 @@
</exclude>
</properties>
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/jetbrains/pty4j/pty4j/0.9.3/pty4j-0.9.3.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/jetbrains/pty4j/pty4j/0.9.4/pty4j-0.9.4.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/jetbrains/pty4j/purejavacomm/0.0.11.1/purejavacomm-0.0.11.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/org/jetbrains/pty4j/pty4j/0.9.3/pty4j-0.9.3-sources.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/jetbrains/pty4j/pty4j/0.9.4/pty4j-0.9.4-sources.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/jetbrains/pty4j/purejavacomm/0.0.11.1/purejavacomm-0.0.11.1-sources.jar!/" />
</SOURCES>
</library>

View File

@@ -1,12 +0,0 @@
<component name="libraryTable">
<library name="xmlgraphics-commons" type="repository">
<properties include-transitive-deps="false" maven-id="org.apache.xmlgraphics:xmlgraphics-commons:2.3" />
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/apache/xmlgraphics/xmlgraphics-commons/2.3/xmlgraphics-commons-2.3.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/org/apache/xmlgraphics/xmlgraphics-commons/2.3/xmlgraphics-commons-2.3-sources.jar!/" />
</SOURCES>
</library>
</component>

2
.idea/modules.xml generated
View File

@@ -480,6 +480,7 @@
<module fileurl="file://$PROJECT_DIR$/plugins/ui-designer/jps-plugin/intellij.java.guiForms.jps.iml" filepath="$PROJECT_DIR$/plugins/ui-designer/jps-plugin/intellij.java.guiForms.jps.iml" />
<module fileurl="file://$PROJECT_DIR$/platform/forms_rt/intellij.java.guiForms.rt.iml" filepath="$PROJECT_DIR$/platform/forms_rt/intellij.java.guiForms.rt.iml" />
<module fileurl="file://$PROJECT_DIR$/plugins/java-i18n/intellij.java.i18n.iml" filepath="$PROJECT_DIR$/plugins/java-i18n/intellij.java.i18n.iml" />
<module fileurl="file://$PROJECT_DIR$/java/ide-resources/intellij.java.ide.resources.iml" filepath="$PROJECT_DIR$/java/ide-resources/intellij.java.ide.resources.iml" />
<module fileurl="file://$PROJECT_DIR$/java/java-impl/intellij.java.impl.iml" filepath="$PROJECT_DIR$/java/java-impl/intellij.java.impl.iml" />
<module fileurl="file://$PROJECT_DIR$/java/java-indexing-api/intellij.java.indexing.iml" filepath="$PROJECT_DIR$/java/java-indexing-api/intellij.java.indexing.iml" />
<module fileurl="file://$PROJECT_DIR$/java/java-indexing-impl/intellij.java.indexing.impl.iml" filepath="$PROJECT_DIR$/java/java-indexing-impl/intellij.java.indexing.impl.iml" />
@@ -527,6 +528,7 @@
<module fileurl="file://$PROJECT_DIR$/jvm/jvm-analysis-java-tests/intellij.jvm.analysis.java.tests.iml" filepath="$PROJECT_DIR$/jvm/jvm-analysis-java-tests/intellij.jvm.analysis.java.tests.iml" />
<module fileurl="file://$PROJECT_DIR$/jvm/jvm-analysis-kotlin-tests/intellij.jvm.analysis.kotlin.tests.iml" filepath="$PROJECT_DIR$/jvm/jvm-analysis-kotlin-tests/intellij.jvm.analysis.kotlin.tests.iml" />
<module fileurl="file://$PROJECT_DIR$/jvm/jvm-analysis-tests-api/intellij.jvm.analysis.tests.iml" filepath="$PROJECT_DIR$/jvm/jvm-analysis-tests-api/intellij.jvm.analysis.tests.iml" />
<module fileurl="file://$PROJECT_DIR$/plugins/markdown/intellij.markdown.iml" filepath="$PROJECT_DIR$/plugins/markdown/intellij.markdown.iml" />
<module fileurl="file://$PROJECT_DIR$/plugins/maven/intellij.maven.iml" filepath="$PROJECT_DIR$/plugins/maven/intellij.maven.iml" />
<module fileurl="file://$PROJECT_DIR$/plugins/maven/artifact-resolver/common/intellij.maven.artifactResolver.common.iml" filepath="$PROJECT_DIR$/plugins/maven/artifact-resolver/common/intellij.maven.artifactResolver.common.iml" />
<module fileurl="file://$PROJECT_DIR$/plugins/maven/artifact-resolver-m2/intellij.maven.artifactResolver.m2.iml" filepath="$PROJECT_DIR$/plugins/maven/artifact-resolver-m2/intellij.maven.artifactResolver.m2.iml" />

View File

@@ -20,7 +20,7 @@
<extensions defaultExtensionNs="com.intellij">
<lang.documentationProvider language="RegExp" implementationClass="org.intellij.lang.regexp.RegExpDocumentationProvider"/>
<completion.contributor language="RegExp" implementationClass="org.intellij.lang.regexp.RegExpCompletionContributor"/>
<fileTypeFactory implementation="org.intellij.lang.regexp.RegExpSupportLoader" />
<fileType name="RegExp" implementationClass="org.intellij.lang.regexp.RegExpFileType" extensions="regexp" fieldName="INSTANCE" language="RegExp"/>
<annotator language="RegExp" implementationClass="org.intellij.lang.regexp.validation.RegExpAnnotator"/>
<lang.parserDefinition language="RegExp" implementationClass="org.intellij.lang.regexp.RegExpParserDefinition"/>
<lang.syntaxHighlighterFactory language="RegExp" implementationClass="org.intellij.lang.regexp.RegExpSyntaxHighlighterFactory"/>

View File

@@ -1,31 +0,0 @@
/*
* Copyright 2006 Sascha Weinreuter
*
* 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.regexp;
import com.intellij.openapi.fileTypes.FileTypeConsumer;
import com.intellij.openapi.fileTypes.FileTypeFactory;
import org.jetbrains.annotations.NotNull;
public class RegExpSupportLoader extends FileTypeFactory {
public static final RegExpLanguage LANGUAGE = RegExpLanguage.INSTANCE;
public static final RegExpFileType FILE_TYPE = RegExpFileType.INSTANCE;
@Override
public void createFileTypes(final @NotNull FileTypeConsumer consumer) {
consumer.consume(FILE_TYPE, FILE_TYPE.getDefaultExtension());
}
}

View File

@@ -1,4 +1,4 @@
// 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.
// Copyright 2000-2019 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 org.intellij.lang.regexp.intention;
import com.intellij.ide.util.PropertiesComponent;
@@ -31,6 +31,7 @@ import com.intellij.psi.impl.source.tree.injected.InjectedLanguageUtil;
import com.intellij.ui.EditorTextField;
import com.intellij.ui.JBColor;
import com.intellij.ui.components.JBLabel;
import com.intellij.ui.scale.JBUIScale;
import com.intellij.util.Alarm;
import com.intellij.util.ui.JBUI;
import com.intellij.util.ui.UIUtil;
@@ -109,7 +110,7 @@ public class CheckRegExpForm {
}
};
mySampleText.setOneLineMode(false);
int preferredWidth = Math.max(JBUI.scale(250), myRegExp.getPreferredSize().width);
int preferredWidth = Math.max(JBUIScale.scale(250), myRegExp.getPreferredSize().width);
myRegExp.setPreferredWidth(preferredWidth);
mySampleText.setPreferredWidth(preferredWidth);

BIN
bin/WinLauncher/WinLauncher.exe Normal file → Executable file

Binary file not shown.

BIN
bin/WinLauncher/WinLauncher64.exe Normal file → Executable file

Binary file not shown.

View File

@@ -5,6 +5,7 @@ buildscript {
}
dependencies {
classpath "de.undercouch:gradle-download-task:3.4.2"
classpath "gradle.plugin.org.jetbrains.gradle.plugin.idea-ext:gradle-idea-ext:0.5"
}
}

View File

@@ -3,7 +3,7 @@
kotlinPluginBuild=1.3.31-release-IJ2019.1-1
jetSignBuild=42.30
secondJreVersion=11
secondJreBuild=11_0_3b262.3
bundledMavenVersion=3.6.0
jdkBuild=u212b1566.8
secondJreBuild=11_0_3b304.2
bundledMavenVersion=3.6.1
jdkBuild=u212b1586.2
gradleApiVersion=5.2.1

View File

@@ -1,14 +1,7 @@
// Copyright 2000-2019 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.
buildscript {
repositories {
maven { url "https://cache-redirector.jetbrains.com/plugins.gradle.org" }
}
dependencies {
classpath "de.undercouch:gradle-download-task:3.2.0"
}
}
apply plugin: "de.undercouch.download"
apply plugin: "org.jetbrains.gradle.plugin.idea-ext"
configurations {
mavenServer3CommonLibs
@@ -18,6 +11,8 @@ configurations {
maven3Distribution.transitive = false
}
dependencies {
mavenServer3CommonLibs 'org.apache.maven.archetype:archetype-common:2.2'
mavenServer3CommonLibs 'org.apache.maven.archetype:archetype-catalog:2.2'
@@ -35,6 +30,7 @@ def mavenDistName = "apache-maven-$bundledMavenVersion"
task unpackMavenDistribution(type: Copy) {
from zipTree(project.configurations.maven3Distribution.singleFile)
into "$mavenServerLibDir/maven3"
onlyIf { (!destinationDir.exists()) || destinationDir.list() == null || destinationDir.list().length == 0 }
}
@@ -43,8 +39,15 @@ task setupCommonLibs(type: Copy) {
into "$communityPluginsDir/maven/maven3-server-common/lib"
}
task deletePreviousMinorVersionIfRequired(type: Delete) {
delete mavenServerLibDir
onlyIf {
new File("$mavenServerLibDir/maven3/lib").exists() && !new File("$mavenServerLibDir/maven3/lib/maven-core-${bundledMavenVersion}.jar").
exists()
}
}
//there is no friendly way to unpack gradle zip without parent dir
task setupBundledMaven(dependsOn: [unpackMavenDistribution, setupCommonLibs], type: Copy) {
task setupBundledMaven(dependsOn: [deletePreviousMinorVersionIfRequired, unpackMavenDistribution, setupCommonLibs], type: Copy) {
def unzippedDir = new File("$mavenServerLibDir/maven3/$mavenDistName")
from fileTree(unzippedDir)
into "$mavenServerLibDir/maven3/"
@@ -53,3 +56,9 @@ task setupBundledMaven(dependsOn: [unpackMavenDistribution, setupCommonLibs], ty
unzippedDir.deleteDir()
}
}
idea.project.settings {
taskTriggers {
afterSync tasks.getByName("setupBundledMaven")
}
}

View File

@@ -18,6 +18,14 @@
<equals arg1="${intellij.build.use.gradle.daemon}" arg2="true"/>
</and>
</condition>
<condition property="gradle.args" value="${intellij.gradle.jdk.build.parameters}" else="--stacktrace">
<and>
<isset property="intellij.gradle.jdk.build.parameters"/>
<not>
<equals arg1="${intellij.gradle.jdk.build.parameters}" arg2=""/>
</not>
</and>
</condition>
<condition property="gradlew" value="gradlew.bat" else="gradlew">
<os family="windows"/>
</condition>
@@ -28,6 +36,7 @@
<env key="JAVA_HOME" value="${java.path}"/>
<arg value="${gradle.daemon}"/>
<arg value="-Djava.io.tmpdir=${java.io.tmpdir}"/>
<arg line="${gradle.args}"/>
<arg value="setupBuildScriptsDeps"/>
</exec>
</target>

View File

@@ -9,50 +9,19 @@ import java.util.function.Consumer
* @author nik
*/
abstract class BaseIdeaProperties extends ProductProperties {
public static final List<String> JAVA_API_MODULES = [
"intellij.java.compiler",
"intellij.java.debugger",
public static final List<String> JAVA_IDE_API_MODULES = [
"intellij.xml.dom",
"intellij.java.execution",
"intellij.java.remoteServers",
"intellij.java.testFramework",
"intellij.platform.testFramework.core",
"intellij.platform.uast.tests"
]
public static final List<String> MAIN_JAVA_API_MODULES = [
"intellij.java.analysis",
"intellij.jvm.analysis",
"intellij.java.indexing",
"intellij.java.psi",
"intellij.java",
"intellij.jsp.base",
"intellij.jsp",
"intellij.platform.uast"
]
public static final List<String> JAVA_IMPLEMENTATION_MODULES = [
"intellij.java.compiler.impl",
"intellij.java.debugger.impl",
"intellij.java.debugger.memory.agent",
public static final List<String> JAVA_IDE_IMPLEMENTATION_MODULES = [
"intellij.xml.dom.impl",
"intellij.java.execution.impl",
"intellij.java.ui",
"intellij.java.structureView",
"intellij.java.manifest",
"intellij.java.remoteServers.impl",
"intellij.platform.testFramework",
"intellij.tools.testsBootstrap",
"intellij.uiDesigner"
]
public static final List<String> MAIN_JAVA_IMPLEMENTATION_MODULES = [
"intellij.java.analysis.impl",
"intellij.jvm.analysis.impl",
"intellij.java.indexing.impl",
"intellij.java.psi.impl",
"intellij.java.impl",
"intellij.jsp.spi",
"intellij.java.uast"
"intellij.tools.testsBootstrap"
]
protected static final List<String> BUNDLED_PLUGIN_MODULES = [
"intellij.java.plugin",
"intellij.copyright",
"intellij.properties",
"intellij.terminal",
@@ -88,7 +57,8 @@ abstract class BaseIdeaProperties extends ProductProperties {
"intellij.android.smali",
"intellij.statsCollector",
"intellij.sh",
"intellij.vcs.changeReminder"
"intellij.vcs.changeReminder",
"intellij.markdown"
]
protected static final Map<String, String> CE_CLASS_VERSIONS = [
"": "1.8",
@@ -96,11 +66,11 @@ abstract class BaseIdeaProperties extends ProductProperties {
"lib/forms_rt.jar": "1.4",
"lib/annotations.jar": "1.5",
"lib/util.jar": "1.8",
"lib/rt/debugger-agent.jar": "1.6",
"lib/rt/debugger-agent-storage.jar": "1.6",
"lib/external-system-rt.jar": "1.6",
"lib/jshell-frontend.jar": "1.9",
"lib/sa-jdwp": "", // ignored
"plugins/java/lib/rt/debugger-agent.jar": "1.6",
"plugins/java/lib/rt/debugger-agent-storage.jar": "1.6",
"plugins/Groovy/lib/groovy_rt.jar": "1.5",
"plugins/Groovy/lib/groovy-rt-constants.jar": "1.5",
"plugins/coverage/lib/coverage_rt.jar": "1.5",
@@ -123,41 +93,27 @@ abstract class BaseIdeaProperties extends ProductProperties {
BaseIdeaProperties() {
productLayout.mainJarName = "idea.jar"
productLayout.moduleExcludes.put("intellij.java.resources.en", "search/searchableOptions.xml")
productLayout.additionalPlatformJars.put("external-system-rt.jar", "intellij.platform.externalSystem.rt")
productLayout.additionalPlatformJars.put("external-system-impl.jar", "intellij.platform.externalSystem.impl")
productLayout.additionalPlatformJars.put("jps-launcher.jar", "intellij.platform.jps.build.launcher")
productLayout.additionalPlatformJars.put("jps-builders.jar", "intellij.platform.jps.build")
productLayout.additionalPlatformJars.put("jps-builders-6.jar", "intellij.platform.jps.build.javac.rt")
productLayout.additionalPlatformJars.put("aether-dependency-resolver.jar", "intellij.java.aetherDependencyResolver")
productLayout.additionalPlatformJars.put("jshell-protocol.jar", "intellij.java.jshell.protocol")
productLayout.additionalPlatformJars.putAll("resources.jar", ["intellij.java.resources", "intellij.java.resources.en"])
//for compatibility with generated Ant build.xml files which refer to this file
productLayout.additionalPlatformJars.
putAll("javac2.jar", ["intellij.java.compiler.antTasks", "intellij.java.guiForms.compiler", "intellij.java.guiForms.rt", "intellij.java.compiler.instrumentationUtil", "intellij.java.compiler.instrumentationUtil.java8", "intellij.java.jps.javacRefScanner8"])
productLayout.additionalPlatformJars.put("resources.jar", "intellij.java.ide.resources")
productLayout.platformLayoutCustomizer = { PlatformLayout layout ->
layout.customize {
MAIN_JAVA_API_MODULES.each {
withModule(it, "java-api.jar", "java_resources_en.jar")
}
MAIN_JAVA_IMPLEMENTATION_MODULES.each {
withModule(it, "java-impl.jar", "java_resources_en.jar")
}
//todo currently intellij.platform.testFramework included into idea.jar depends on this jar so it cannot be moved to java plugin
withModule("intellij.java.rt", "idea_rt.jar", null)
withArtifact("debugger-agent", "rt")
withArtifact("debugger-agent-storage", "rt")
withProjectLibrary("Eclipse")
withProjectLibrary("jgoodies-common")
withProjectLibrary("commons-net")
withProjectLibrary("snakeyaml")
//for compatibility with users' projects which take these libraries from IDEA installation
withProjectLibrary("jetbrains-annotations")
withoutProjectLibrary("Ant")
withoutProjectLibrary("Gradle")
removeVersionFromProjectLibraryJarNames("jetbrains-annotations")
withProjectLibrary("JUnit3")
removeVersionFromProjectLibraryJarNames("JUnit3") //for compatibility with users projects which refer to IDEA_HOME/lib/junit.jar
withProjectLibrary("commons-net")
withoutProjectLibrary("Ant")
withoutProjectLibrary("Gradle")
}
} as Consumer<PlatformLayout>

View File

@@ -18,18 +18,17 @@ class IdeaCommunityProperties extends BaseIdeaProperties {
toolsJarRequired = true
buildCrossPlatformDistribution = true
productLayout.productApiModules = JAVA_API_MODULES
productLayout.productImplementationModules = JAVA_IMPLEMENTATION_MODULES + [
productLayout.productApiModules = JAVA_IDE_API_MODULES
productLayout.productImplementationModules = JAVA_IDE_IMPLEMENTATION_MODULES + [
"intellij.platform.duplicates.analysis",
"intellij.platform.structuralSearch",
"intellij.java.structuralSearch",
"intellij.java.typeMigration",
"intellij.platform.main"
]
productLayout.additionalPlatformJars.put("resources.jar", "intellij.idea.community.resources")
productLayout.bundledPluginModules = BUNDLED_PLUGIN_MODULES
productLayout.compatiblePluginsToIgnore = PythonCommunityPluginModules.PYCHARM_ONLY_PLUGIN_MODULES + ["intellij.java.plugin"]
productLayout.allNonTrivialPlugins = CommunityRepositoryModules.COMMUNITY_REPOSITORY_PLUGINS + [
JavaPluginLayout.javaPlugin(false),
CommunityRepositoryModules.androidPlugin([:]),
CommunityRepositoryModules.groovyPlugin([])
]

View File

@@ -7,5 +7,6 @@
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module" module-name="intellij.java.ide.resources" scope="RUNTIME" />
</component>
</module>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 309 B

View File

@@ -12,14 +12,16 @@
<g transform="translate(1 1)">
<use fill="#000" xlink:href="#idea-ce-eap_16-a"/>
<use fill="url(#idea-ce-eap_16-b)" xlink:href="#idea-ce-eap_16-a"/>
<polygon fill="#FFF" points="4.165 3.217 4.165 6.782 4.83 6.782 4.83 8 2.17 8 2.17 6.782 2.835 6.782 2.835 3.217 2.17 3.217 2.17 2 4.83 2 4.83 3.217"/>
<path fill="#FFF" d="M5.7769,7.2256 L6.6149,6.2926 C6.9609,6.6726 7.2979,6.8976 7.7199,6.8976 C8.2209,6.8976 8.5319,6.5946 8.5319,5.8956 L8.5319,1.9996 L9.8969,1.9996 L9.8969,5.9556 C9.8969,6.6726 9.6899,7.2076 9.3269,7.5716 C8.9559,7.9426 8.4119,8.1326 7.7549,8.1326 C6.8139,8.1326 6.1919,7.7176 5.7769,7.2256"/>
<polygon fill="#FFF" points="4.165 3.014 4.165 5.985 4.83 5.985 4.83 7 2.17 7 2.17 5.985 2.835 5.985 2.835 3.014 2.17 3.014 2.17 2 4.83 2 4.83 3.014"/>
<path fill="#FFF" d="M5.7769,6.26015764 L6.6149,5.49951847 C6.9609,5.80931792 7.2979,5.9927518 7.7199,5.9927518 C8.2209,5.9927518 8.5319,5.74572751 8.5319,5.17585958 L8.5319,1.9996 L9.8969,1.9996 L9.8969,5.22477528 C9.8969,5.80931792 9.6899,6.24548293 9.3269,6.54223819 C8.9559,6.84470028 8.4119,6.9996 7.7549,6.9996 C6.8139,6.9996 6.1919,6.66126639 5.7769,6.26015764"/>
<polygon fill="#FFF" points="2 12 8 12 8 11 2 11"/>
</g>
<g transform="translate(7 11)">
<polygon fill="#D99E2B" points="0 5 9 5 9 0 0 0"/>
<polygon fill="#000" points="1 4 2.875 4 2.875 3.525 1.45 3.525 1.45 2.725 2.7 2.725 2.7 2.25 1.45 2.25 1.45 1.475 2.85 1.475 2.85 1 1 1"/>
<path fill="#000" d="M4.05005 2.8249L4.50005 1.6249 4.97505 2.8249 4.05005 2.8249zM3.10005 3.9999L3.57505 3.9999 3.85005 3.27515 5.12505 3.27515 5.3998 3.9999 5.8998 3.9999 4.72505.9999 4.2748.9999 3.10005 3.9999zM6.453625 2.55L6.453625 1.475 6.899875 1.475C7.242375 1.475 7.399875 1.65 7.425125 1.925L7.425125 2.025C7.425125 2.322 7.261375 2.55 6.975125 2.55L6.453625 2.55zM6.453625 4L6.453625 3.025 6.875125 3.025C7.447875 3.0355 7.877875 2.587 7.877875 2.076L7.877875 1.951C7.877875 1.39625 7.483875 1 6.970125 1L6.000125 1 6.000125 4 6.453625 4z"/>
<g transform="translate(3 9)">
<polygon fill="#D99E2B" points="0 7 13 7 13 0 0 0"/>
<polygon fill="#000" points="1 1 4 1 4 1.8 1.8 1.8 1.8 3 3.5 3 3.5 3.8 1.8 3.8 1.8 5.2 3.998 5.2 3.998 6 1 6"/>
<path fill="#000" d="M11.2 2.709C11.2 3.204 11.0134 3.584 10.5554 3.584L9.8 3.584 9.8 1.791 10.4364 1.791C10.9834 1.791 11.16 2.084 11.2 2.541L11.2 2.709zM8.9974 1L8.9974 6 9.8 6 9.8 4.375 10.3954 4.375C11.3114 4.393 12.0004 3.645 12.0004 2.792L12.0004 2.585C12.0004 1.66 11.3694 1 10.5474 1L8.9974 1zM5.8008 4L6.5208 2.041 7.2798 4 5.8008 4zM6.8798 1L6.1598 1 4.2808 6 5.0398 6 5.4808 4.8 7.5188 4.8 7.9598 6 8.7578 6 6.8798 1z"/>
</g>
<polygon fill="#FFF" points="5.165 4.014 5.165 6.985 5.83 6.985 5.83 8 3.17 8 3.17 6.985 3.835 6.985 3.835 4.014 3.17 4.014 3.17 3 5.83 3 5.83 4.014"/>
<path fill="#FFF" d="M7.6149,6.49951847 C7.9609,6.80931792 8.2979,6.9927518 8.7199,6.9927518 C9.2209,6.9927518 9.5319,6.74572751 9.5319,6.17585958 L9.5319,2.9996 L10.8969,2.9996 L10.8969,6.22477528 C10.8969,6.80931792 10.6899,7.24548293 10.3269,7.54223819 C9.9559,7.84470028 9.4119,7.9996 8.7549,7.9996 C7.8139,7.9996 7.1919,7.66126639 6.7769,7.26015764 L7.6149,6.49951847 Z"/>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

View File

@@ -10,6 +10,7 @@
<icon-eap svg="/idea-ce-eap.svg" svg-small="/idea-ce-eap_16.svg"/>
<package code="__PACKAGE_CODE__"/>
<names product="IDEA" fullname="IntelliJ IDEA" edition="Community Edition" script="idea" motto="Capable and Ergonomic IDE for JVM"/>
<essential-plugin>com.intellij.java</essential-plugin>
<welcome-screen logo-url="/Logo_welcomeScreen_CE.png"/>
<customize-ide-wizard provider="com.intellij.ide.customize.CustomizeIdeaWizardStepsProvider"/>

View File

@@ -18,6 +18,8 @@
<projectService serviceInterface="org.intellij.images.thumbnail.ThumbnailManager"
serviceImplementation="org.intellij.images.thumbnail.impl.ThumbnailManagerImpl"/>
<fileTypeFactory implementation="org.intellij.images.fileTypes.impl.ImageFileTypeManagerImpl" />
<fileType name="SVG" implementationClass="org.intellij.images.fileTypes.impl.SvgFileType" fieldName="INSTANCE" extensions="svg" language="SVG"/>
<lang.parserDefinition language="SVG" implementationClass="org.intellij.images.fileTypes.impl.SvgParserDefinition"/>
<fileBasedIndex implementation="org.intellij.images.index.ImageInfoIndex"/>
<fileLookupInfoProvider implementation="org.intellij.images.completion.ImageLookupInfoProvider"/>
<documentationProvider implementation="org.intellij.images.fileTypes.ImageDocumentationProvider"/>

View File

@@ -32,6 +32,7 @@ import com.intellij.util.ObjectUtils;
import com.intellij.util.containers.ContainerUtil;
import com.intellij.util.containers.JBIterable;
import com.intellij.util.ui.JBUI;
import com.intellij.util.ui.StartupUiUtil;
import com.intellij.util.ui.UIUtil;
import com.intellij.util.ui.update.UiNotifyConnector;
import org.intellij.images.fileTypes.ImageFileTypeManager;

View File

@@ -35,10 +35,10 @@ import com.intellij.ui.PopupHandler;
import com.intellij.ui.ScrollPaneFactory;
import com.intellij.ui.components.JBLayeredPane;
import com.intellij.ui.components.Magnificator;
import com.intellij.ui.scale.ScaleContext;
import com.intellij.util.LazyInitializer.NotNullValue;
import com.intellij.util.SVGLoader;
import com.intellij.util.ui.JBUI;
import com.intellij.util.ui.JBUIScale.ScaleContext;
import org.intellij.images.ImagesBundle;
import org.intellij.images.editor.ImageDocument;
import org.intellij.images.editor.ImageDocument.ScaledImageProvider;

View File

@@ -72,6 +72,5 @@ final class ImageFileTypeManagerImpl extends ImageFileTypeManager {
processed.add(StringUtil.toLowerCase(IfsUtil.ICO_FORMAT));
consumer.consume(IMAGE_FILE_TYPE, StringUtil.join(processed, FileTypeConsumer.EXTENSION_DELIMITER));
consumer.consume(SvgFileType.INSTANCE, "svg");
}
}

View File

@@ -16,7 +16,6 @@
package org.intellij.images.fileTypes.impl;
import com.intellij.ide.highlighter.XmlLikeFileType;
import com.intellij.lang.xml.XMLLanguage;
import com.intellij.openapi.fileTypes.UIBasedFileType;
import icons.ImagesIcons;
import org.jetbrains.annotations.NotNull;
@@ -31,7 +30,7 @@ public final class SvgFileType extends XmlLikeFileType implements UIBasedFileTyp
public static final SvgFileType INSTANCE = new SvgFileType();
private SvgFileType() {
super(XMLLanguage.INSTANCE);
super(SvgLanguage.INSTANCE);
}
@NotNull

View File

@@ -0,0 +1,25 @@
// Copyright 2000-2019 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 org.intellij.images.fileTypes.impl
import com.intellij.lang.xml.XMLLanguage
import com.intellij.lang.xml.XMLParserDefinition
import com.intellij.psi.FileViewProvider
import com.intellij.psi.PsiFile
import com.intellij.psi.impl.source.xml.XmlFileImpl
import com.intellij.psi.tree.IFileElementType
class SvgLanguage : XMLLanguage(XMLLanguage.INSTANCE, "SVG", "image/svg+xml") {
companion object {
@JvmField val INSTANCE = SvgLanguage()
}
}
class SvgParserDefinition : XMLParserDefinition() {
override fun getFileNodeType(): IFileElementType = SVG_FILE
override fun createFile(viewProvider: FileViewProvider): PsiFile = XmlFileImpl(viewProvider, SVG_FILE)
companion object {
val SVG_FILE = IFileElementType(SvgLanguage.INSTANCE)
}
}

View File

@@ -1,18 +1,4 @@
/*
* 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-2019 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 org.intellij.images.thumbnail.impl;
import com.intellij.ide.CopyPasteDelegator;
@@ -667,7 +653,7 @@ final class ThumbnailViewUI extends JPanel implements DataProvider, Disposable {
public void fileDeleted(@NotNull VirtualFileEvent event) {
VirtualFile file = event.getFile();
VirtualFile root = thumbnailView.getRoot();
if (root != null && VfsUtil.isAncestor(file, root, false)) {
if (root != null && VfsUtilCore.isAncestor(file, root, false)) {
refresh();
}
if (list != null) {

View File

@@ -1,22 +1,8 @@
/*
* Copyright 2000-2009 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-2019 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 org.intellij.images.ui;
import com.intellij.ui.scale.ScaleContext;
import com.intellij.util.containers.ContainerUtil;
import com.intellij.util.ui.JBUIScale.ScaleContext;
import org.intellij.images.ImagesBundle;
import org.intellij.images.editor.ImageDocument;
import org.intellij.images.options.GridOptions;
@@ -33,7 +19,7 @@ import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.util.List;
import static com.intellij.util.ui.JBUIScale.ScaleType.OBJ_SCALE;
import static com.intellij.ui.scale.ScaleType.OBJ_SCALE;
/**
* Image component is draw image box with effects.

View File

@@ -1,20 +1,7 @@
/*
* Copyright 2000-2009 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-2019 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 org.intellij.images.ui;
import com.intellij.util.ui.StartupUiUtil;
import com.intellij.util.ui.UIUtil;
import org.intellij.images.editor.ImageDocument;
@@ -115,7 +102,7 @@ public class ImageComponentUI extends ComponentUI {
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
g2d.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR);
}
UIUtil.drawImage(g, image, new Rectangle(0, 0, size.width, size.height), ic);
StartupUiUtil.drawImage(g, image, new Rectangle(0, 0, size.width, size.height), ic);
g2d.setRenderingHints(oldHints);
}

View File

@@ -1,25 +1,11 @@
/*
* 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-2019 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 org.intellij.images.ui;
import com.intellij.ide.ui.UISettings;
import com.intellij.openapi.ui.Messages;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.ui.JBColor;
import com.intellij.util.ui.UIUtil;
import com.intellij.util.ui.StartupUiUtil;
import icons.ImagesIcons;
import org.intellij.images.ImagesBundle;
import org.intellij.images.editor.ImageDocument;
@@ -202,7 +188,7 @@ public class ThumbnailComponentUI extends ComponentUI {
}
private void paintFileName(Graphics g, ThumbnailComponent tc) {
Font font = UIUtil.getLabelFont();
Font font = StartupUiUtil.getLabelFont();
FontMetrics fontMetrics = g.getFontMetrics(font);
g.setFont(font);
@@ -262,13 +248,13 @@ public class ThumbnailComponentUI extends ComponentUI {
}
private static Font getSmallFont() {
Font labelFont = UIUtil.getLabelFont();
Font labelFont = StartupUiUtil.getLabelFont();
return labelFont.deriveFont(labelFont.getSize2D() - 2.0f);
}
@Override
public Dimension getPreferredSize(JComponent c) {
Font labelFont = UIUtil.getLabelFont();
Font labelFont = StartupUiUtil.getLabelFont();
FontMetrics fontMetrics = c.getFontMetrics(labelFont);
return new Dimension(
ImagesIcons.ThumbnailBlank.getIconWidth() + 10,

View File

@@ -16,6 +16,7 @@
package org.intellij.images.util;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.util.ImageLoader;
import com.intellij.util.SVGLoader;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -24,7 +25,6 @@ import javax.imageio.ImageIO;
import javax.imageio.ImageReader;
import javax.imageio.ImageTypeSpecifier;
import javax.imageio.stream.ImageInputStream;
import java.awt.geom.Dimension2D;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.util.Arrays;
@@ -72,7 +72,7 @@ public class ImageInfoReader {
private static Info getSvgSize(byte[] data) {
try {
Dimension2D size = SVGLoader.getDocumentSize(null, new ByteArrayInputStream(data), 1.0f);
ImageLoader.Dimension2DDouble size = SVGLoader.getDocumentSize(null, new ByteArrayInputStream(data), 1.0f);
return new Info((int)Math.round(size.getWidth()), (int)Math.round(size.getHeight()), 32, true);
}
catch (Throwable e) {

View File

@@ -1,18 +1,4 @@
/*
* Copyright 2000-2013 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-2019 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 org.intellij.images.vfs;
import com.intellij.openapi.diagnostic.Logger;
@@ -24,10 +10,10 @@ import com.intellij.openapi.util.Ref;
import com.intellij.openapi.vfs.VfsUtilCore;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.reference.SoftReference;
import com.intellij.ui.scale.ScaleContext;
import com.intellij.util.LogicalRoot;
import com.intellij.util.LogicalRootsManager;
import com.intellij.util.SVGLoader;
import com.intellij.util.ui.JBUIScale.ScaleContext;
import org.apache.commons.imaging.ImageReadException;
import org.apache.commons.imaging.common.bytesource.ByteSourceArray;
import org.apache.commons.imaging.formats.ico.IcoImageParser;
@@ -50,7 +36,7 @@ import java.net.MalformedURLException;
import java.net.URL;
import java.util.Iterator;
import static com.intellij.util.ui.JBUIScale.ScaleType.OBJ_SCALE;
import static com.intellij.ui.scale.ScaleType.OBJ_SCALE;
/**
* Image loader utility.

View File

@@ -43,6 +43,7 @@
<orderEntry type="module" module-name="intellij.platform.resources" scope="RUNTIME" />
<orderEntry type="module" module-name="intellij.platform.resources.en" scope="RUNTIME" />
<orderEntry type="module" module-name="intellij.properties" scope="RUNTIME" />
<orderEntry type="module" module-name="intellij.java.ide.resources" scope="RUNTIME" />
<orderEntry type="module" module-name="intellij.java.resources" scope="RUNTIME" />
<orderEntry type="module" module-name="intellij.java.resources.en" scope="RUNTIME" />
<orderEntry type="module" module-name="intellij.spellchecker" scope="RUNTIME" />
@@ -58,6 +59,7 @@
<orderEntry type="module" module-name="intellij.xml.impl" scope="RUNTIME" />
<orderEntry type="module" module-name="intellij.xml" scope="RUNTIME" />
<orderEntry type="module" module-name="intellij.idea.community.resources" scope="RUNTIME" />
<orderEntry type="module" module-name="intellij.java.plugin" scope="RUNTIME" />
<orderEntry type="module" module-name="intellij.java.tests" scope="TEST" />
<orderEntry type="module" module-name="intellij.copyright" scope="RUNTIME" />
<orderEntry type="module" module-name="intellij.platform.testFramework" scope="RUNTIME" />

View File

@@ -1,26 +1,26 @@
// Copyright 2000-2019 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.compiler
import com.intellij.internal.statistic.beans.UsageDescriptor
import com.intellij.internal.statistic.beans.MetricEvent
import com.intellij.internal.statistic.beans.newBooleanMetric
import com.intellij.internal.statistic.service.fus.collectors.ProjectUsagesCollector
import com.intellij.internal.statistic.utils.getBooleanUsage
import com.intellij.openapi.project.Project
class CompilerSettingsCollector : ProjectUsagesCollector() {
override fun getGroupId() = "java.compiler.settings.project"
override fun getUsages(project: Project): Set<UsageDescriptor> {
val usages = mutableSetOf<UsageDescriptor>()
override fun getMetrics(project: Project): MutableSet<MetricEvent> {
val usages = mutableSetOf<MetricEvent>()
val config = CompilerWorkspaceConfiguration.getInstance(project)
usages.add(getBooleanUsage("AUTO_SHOW_ERRORS_IN_EDITOR", config.AUTO_SHOW_ERRORS_IN_EDITOR))
usages.add(getBooleanUsage("DISPLAY_NOTIFICATION_POPUP", config.DISPLAY_NOTIFICATION_POPUP))
usages.add(getBooleanUsage("CLEAR_OUTPUT_DIRECTORY", config.CLEAR_OUTPUT_DIRECTORY))
usages.add(getBooleanUsage("MAKE_PROJECT_ON_SAVE", config.MAKE_PROJECT_ON_SAVE))
usages.add(getBooleanUsage("PARALLEL_COMPILATION", config.PARALLEL_COMPILATION))
usages.add(getBooleanUsage("REBUILD_ON_DEPENDENCY_CHANGE", config.REBUILD_ON_DEPENDENCY_CHANGE))
usages.add(getBooleanUsage("COMPILE_AFFECTED_UNLOADED_MODULES_BEFORE_COMMIT", config.COMPILE_AFFECTED_UNLOADED_MODULES_BEFORE_COMMIT))
usages.add(newBooleanMetric("AUTO_SHOW_ERRORS_IN_EDITOR", config.AUTO_SHOW_ERRORS_IN_EDITOR))
usages.add(newBooleanMetric("DISPLAY_NOTIFICATION_POPUP", config.DISPLAY_NOTIFICATION_POPUP))
usages.add(newBooleanMetric("CLEAR_OUTPUT_DIRECTORY", config.CLEAR_OUTPUT_DIRECTORY))
usages.add(newBooleanMetric("MAKE_PROJECT_ON_SAVE", config.MAKE_PROJECT_ON_SAVE))
usages.add(newBooleanMetric("PARALLEL_COMPILATION", config.PARALLEL_COMPILATION))
usages.add(newBooleanMetric("REBUILD_ON_DEPENDENCY_CHANGE", config.REBUILD_ON_DEPENDENCY_CHANGE))
usages.add(newBooleanMetric("COMPILE_AFFECTED_UNLOADED_MODULES_BEFORE_COMMIT", config.COMPILE_AFFECTED_UNLOADED_MODULES_BEFORE_COMMIT))
return usages
}

View File

@@ -17,7 +17,10 @@ import com.intellij.openapi.progress.Task;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.ui.Messages;
import com.intellij.openapi.util.io.FileUtil;
import com.intellij.openapi.vfs.*;
import com.intellij.openapi.vfs.LocalFileSystem;
import com.intellij.openapi.vfs.ReadonlyStatusHandler;
import com.intellij.openapi.vfs.VfsUtilCore;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.util.containers.ContainerUtil;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
@@ -98,7 +101,7 @@ public class GenerateAntBuildAction extends CompileActionBase {
try {
if (genOptions.generateSingleFile) {
final File projectBuildFileDestDir = VfsUtil.virtualToIoFile(project.getBaseDir());
final File projectBuildFileDestDir = VfsUtilCore.virtualToIoFile(project.getBaseDir());
final File destFile = new File(projectBuildFileDestDir, genOptions.getBuildFileName());
final File propertiesFile = new File(projectBuildFileDestDir, genOptions.getPropertiesFileName());
@@ -107,7 +110,7 @@ public class GenerateAntBuildAction extends CompileActionBase {
else {
final List<File> allFiles = new ArrayList<>();
final File projectBuildFileDestDir = VfsUtil.virtualToIoFile(project.getBaseDir());
final File projectBuildFileDestDir = VfsUtilCore.virtualToIoFile(project.getBaseDir());
allFiles.add(new File(projectBuildFileDestDir, genOptions.getBuildFileName()));
allFiles.add(new File(projectBuildFileDestDir, genOptions.getPropertiesFileName()));
@@ -198,7 +201,7 @@ public class GenerateAntBuildAction extends CompileActionBase {
}
private File[] generateSingleFileBuild(Project project, GenerationOptions genOptions, List<? super File> filesToRefresh) throws IOException {
final File projectBuildFileDestDir = VfsUtil.virtualToIoFile(project.getBaseDir());
final File projectBuildFileDestDir = VfsUtilCore.virtualToIoFile(project.getBaseDir());
projectBuildFileDestDir.mkdirs();
final File destFile = new File(projectBuildFileDestDir, genOptions.getBuildFileName());
final File propertiesFile = new File(projectBuildFileDestDir, genOptions.getPropertiesFileName());

View File

@@ -1,18 +1,4 @@
/*
* Copyright 2000-2009 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-2019 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.compiler.ant.artifacts;
import com.intellij.compiler.ant.BuildProperties;
@@ -22,7 +8,7 @@ import com.intellij.compiler.ant.Generator;
import com.intellij.compiler.ant.taskdefs.Mkdir;
import com.intellij.compiler.ant.taskdefs.Property;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.vfs.VfsUtil;
import com.intellij.openapi.vfs.VfsUtilCore;
import com.intellij.packaging.artifacts.Artifact;
import com.intellij.packaging.elements.ArtifactAntGenerationContext;
import com.intellij.packaging.impl.artifacts.ArtifactUtil;
@@ -105,7 +91,7 @@ public class ArtifactAntGenerationContextImpl implements ArtifactAntGenerationCo
@Override
public String getSubstitutedPath(String path) {
return GenerationUtils.toRelativePath(path, VfsUtil.virtualToIoFile(myProject.getBaseDir()), BuildProperties.getProjectBaseDirProperty(), myGenerationOptions);
return GenerationUtils.toRelativePath(path, VfsUtilCore.virtualToIoFile(myProject.getBaseDir()), BuildProperties.getProjectBaseDirProperty(), myGenerationOptions);
}
@Override

View File

@@ -94,7 +94,7 @@ public abstract class CompilerReferenceServiceBase<Reader extends CompilerRefere
@Override
public void projectOpened() {
if (CompilerReferenceService.isEnabled()) {
myDirtyScopeHolder.installVFSListener();
myDirtyScopeHolder.installVFSListener(myProject);
if (!ApplicationManager.getApplication().isUnitTestMode()) {
CompilerManager compilerManager = CompilerManager.getInstance(myProject);

View File

@@ -5,6 +5,7 @@ import com.intellij.ProjectTopics;
import com.intellij.compiler.CompilerConfiguration;
import com.intellij.compiler.CompilerReferenceService;
import com.intellij.compiler.backwardRefs.view.DirtyScopeTestInfo;
import com.intellij.openapi.Disposable;
import com.intellij.openapi.application.ReadAction;
import com.intellij.openapi.compiler.options.ExcludeEntryDescription;
import com.intellij.openapi.compiler.options.ExcludedEntriesListener;
@@ -15,14 +16,15 @@ import com.intellij.openapi.fileTypes.FileTypeRegistry;
import com.intellij.openapi.module.Module;
import com.intellij.openapi.module.ModuleManager;
import com.intellij.openapi.progress.ProcessCanceledException;
import com.intellij.openapi.progress.ProgressManager;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.roots.ModuleRootEvent;
import com.intellij.openapi.roots.ModuleRootListener;
import com.intellij.openapi.util.UserDataHolderBase;
import com.intellij.openapi.util.io.FileUtil;
import com.intellij.openapi.vfs.AsyncFileListener;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.openapi.vfs.VirtualFileManager;
import com.intellij.openapi.vfs.newvfs.BulkFileListener;
import com.intellij.openapi.vfs.newvfs.events.*;
import com.intellij.psi.PsiDocumentManager;
import com.intellij.psi.PsiFile;
@@ -34,14 +36,16 @@ import com.intellij.util.SmartList;
import com.intellij.util.containers.ContainerUtil;
import com.intellij.util.messages.MessageBusConnection;
import gnu.trove.THashSet;
import org.jetbrains.annotations.Contract;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.annotations.TestOnly;
import java.util.*;
import java.util.function.BiConsumer;
@SuppressWarnings("WeakerAccess")
public class DirtyScopeHolder extends UserDataHolderBase implements BulkFileListener {
public class DirtyScopeHolder extends UserDataHolderBase implements AsyncFileListener {
private final CompilerReferenceServiceBase<?> myService;
private final FileDocumentManager myFileDocManager;
private final PsiDocumentManager myPsiDocManager;
@@ -200,8 +204,25 @@ public class DirtyScopeHolder extends UserDataHolderBase implements BulkFileList
return getDirtyScope().contains(file);
}
@Nullable
@Override
public void after(@NotNull List<? extends VFileEvent> events) {
public ChangeApplier prepareChange(@NotNull List<? extends VFileEvent> events) {
final List<Module> modulesToBeMarkedDirty = getModulesToBeMarkedDirtyBefore(events);
return new ChangeApplier() {
@Override
public void beforeVfsChange() {
modulesToBeMarkedDirty.forEach(DirtyScopeHolder.this::addToDirtyModules);
}
@Override
public void afterVfsChange() {
after(events);
}
};
}
private void after(@NotNull List<? extends VFileEvent> events) {
for (VFileEvent event : events) {
if (event instanceof VFileCreateEvent || event instanceof VFileCopyEvent || event instanceof VFileMoveEvent) {
VirtualFile file = event.getFile();
@@ -219,12 +240,20 @@ public class DirtyScopeHolder extends UserDataHolderBase implements BulkFileList
}
}
@Override
public void before(@NotNull List<? extends VFileEvent> events) {
@Contract(pure=true)
@NotNull
private List<Module> getModulesToBeMarkedDirtyBefore(@NotNull List<? extends VFileEvent> events) {
final List<Module> modulesToBeMarkedDirty = new ArrayList<>();
for (VFileEvent event : events) {
ProgressManager.checkCanceled();
if (event instanceof VFileDeleteEvent || event instanceof VFileMoveEvent || event instanceof VFileContentChangeEvent) {
VirtualFile file = event.getFile();
fileChanged(file);
if (file != null) {
final Module module = getModuleForSourceContentFile(file);
ContainerUtil.addIfNotNull(modulesToBeMarkedDirty, module);
}
}
else if (event instanceof VFilePropertyChangeEvent) {
VFilePropertyChangeEvent pce = (VFilePropertyChangeEvent)event;
@@ -233,16 +262,17 @@ public class DirtyScopeHolder extends UserDataHolderBase implements BulkFileList
final String path = pce.getFile().getPath();
for (Module module : ModuleManager.getInstance(myService.getProject()).getModules()) {
if (FileUtil.isAncestor(path, module.getModuleFilePath(), true)) {
addToDirtyModules(module);
modulesToBeMarkedDirty.add(module);
}
}
}
}
}
return modulesToBeMarkedDirty;
}
public void installVFSListener() {
myService.getProject().getMessageBus().connect().subscribe(VirtualFileManager.VFS_CHANGES, this);
public void installVFSListener(@NotNull Disposable parentDisposable) {
VirtualFileManager.getInstance().addAsyncFileListener(this, parentDisposable);
}
private void fileChanged(@NotNull VirtualFile file) {
@@ -251,6 +281,7 @@ public class DirtyScopeHolder extends UserDataHolderBase implements BulkFileList
addToDirtyModules(module);
}
}
private void addToDirtyModules(@NotNull Module module) {
synchronized (myLock) {
if (myCompilationPhase) {

View File

@@ -11,7 +11,7 @@ import com.intellij.openapi.actionSystem.*;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.command.CommandProcessor;
import com.intellij.openapi.fileEditor.OpenFileDescriptor;
import com.intellij.openapi.module.LanguageLevelUtil;
import com.intellij.openapi.module.EffectiveLanguageLevelUtil;
import com.intellij.openapi.module.Module;
import com.intellij.openapi.module.ModuleUtilCore;
import com.intellij.openapi.project.Project;
@@ -113,7 +113,7 @@ public class CompilerErrorTreeView extends NewErrorTreeViewPanel {
if (psiFile == null) {
return;
}
if (LanguageLevelUtil.getEffectiveLanguageLevel(module).compareTo(LanguageLevel.JDK_1_5) < 0) return;
if (EffectiveLanguageLevelUtil.getEffectiveLanguageLevel(module).compareTo(LanguageLevel.JDK_1_5) < 0) return;
final PsiElement context = psiFile.findElementAt(fileDescriptor.getOffset());
if (context == null) {
return;

View File

@@ -1,25 +1,11 @@
/*
* Copyright 2000-2009 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-2019 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.compiler.impl;
import com.intellij.openapi.compiler.CompileScope;
import com.intellij.openapi.compiler.ExportableUserDataHolderBase;
import com.intellij.openapi.fileTypes.FileType;
import com.intellij.openapi.roots.FileIndex;
import com.intellij.openapi.vfs.VfsUtil;
import com.intellij.openapi.vfs.VfsUtilCore;
import com.intellij.openapi.vfs.VirtualFile;
import org.jetbrains.annotations.NotNull;
@@ -41,6 +27,6 @@ public abstract class FileIndexCompileScope extends ExportableUserDataHolderBase
for (final FileIndex fileIndex : fileIndices) {
fileIndex.iterateContent(new CompilerContentIterator(fileType, fileIndex, inSourceOnly, files));
}
return VfsUtil.toVirtualFileArray(files);
return VfsUtilCore.toVirtualFileArray(files);
}
}

View File

@@ -1,18 +1,4 @@
/*
* Copyright 2000-2009 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-2019 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.compiler.impl;
import com.intellij.openapi.compiler.CompileScope;
@@ -20,13 +6,13 @@ import com.intellij.openapi.compiler.ExportableUserDataHolderBase;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.fileTypes.FileType;
import com.intellij.openapi.module.Module;
import com.intellij.openapi.module.ModuleUtil;
import com.intellij.openapi.module.ModuleUtilCore;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.roots.ContentIterator;
import com.intellij.openapi.roots.ProjectFileIndex;
import com.intellij.openapi.roots.ProjectRootManager;
import com.intellij.openapi.util.io.FileUtil;
import com.intellij.openapi.vfs.VfsUtil;
import com.intellij.openapi.vfs.VfsUtilCore;
import com.intellij.openapi.vfs.VirtualFile;
import org.jetbrains.annotations.NotNull;
@@ -58,7 +44,7 @@ public class OneProjectItemCompileScope extends ExportableUserDataHolderBase imp
else{
iterator.processFile(myFile);
}
return VfsUtil.toVirtualFileArray(files);
return VfsUtilCore.toVirtualFileArray(files);
}
@Override
@@ -72,7 +58,7 @@ public class OneProjectItemCompileScope extends ExportableUserDataHolderBase imp
@Override
@NotNull
public Module[] getAffectedModules() {
final Module module = ModuleUtil.findModuleForFile(myFile, myProject);
final Module module = ModuleUtilCore.findModuleForFile(myFile, myProject);
if (module == null) {
LOG.error("Module is null for file " + myFile.getPresentableUrl());
return Module.EMPTY_ARRAY;

View File

@@ -18,8 +18,8 @@ package com.intellij.compiler.impl;
import com.intellij.compiler.server.BuildManager;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.application.PathManager;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.fileTypes.FileTypeManager;
import com.intellij.openapi.progress.ProgressManager;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.project.ProjectManager;
import com.intellij.openapi.project.ProjectUtil;
@@ -27,10 +27,8 @@ import com.intellij.openapi.roots.ProjectRootManager;
import com.intellij.openapi.util.Comparing;
import com.intellij.openapi.util.io.FileUtil;
import com.intellij.openapi.vfs.*;
import com.intellij.openapi.vfs.newvfs.BulkFileListener;
import com.intellij.openapi.vfs.newvfs.NewVirtualFile;
import com.intellij.openapi.vfs.newvfs.events.*;
import com.intellij.util.messages.MessageBus;
import gnu.trove.THashSet;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -52,14 +50,7 @@ import java.util.Set;
* 1. corresponding source file has been scheduled for recompilation (see above)
* 2. corresponding source file has been deleted
*/
public class TranslatingCompilerFilesMonitor implements BulkFileListener {
private static final Logger LOG = Logger.getInstance("#com.intellij.compiler.impl.TranslatingCompilerFilesMonitor");
private final BuildManager myBuildManager;
public TranslatingCompilerFilesMonitor(MessageBus bus, BuildManager buildManager) {
myBuildManager = buildManager;
bus.connect().subscribe(VirtualFileManager.VFS_CHANGES, this);
}
public class TranslatingCompilerFilesMonitor implements AsyncFileListener {
public static TranslatingCompilerFilesMonitor getInstance() {
return ApplicationManager.getApplication().getComponent(TranslatingCompilerFilesMonitor.class);
@@ -78,6 +69,7 @@ public class TranslatingCompilerFilesMonitor implements BulkFileListener {
VfsUtilCore.visitChildrenRecursively(fromFile, new VirtualFileVisitor() {
@NotNull @Override
public Result visitFileEx(@NotNull VirtualFile file) {
ProgressManager.checkCanceled();
if (isIgnoredByBuild(file)) {
return SKIP_CHILDREN;
}
@@ -117,8 +109,8 @@ public class TranslatingCompilerFilesMonitor implements BulkFileListener {
}
@Override
public void before(@NotNull List<? extends VFileEvent> events) {
Collection<File> filesDeleted = new THashSet<>(FileUtil.FILE_HASHING_STRATEGY);
public ChangeApplier prepareChange(@NotNull List<? extends VFileEvent> events) {
Set<File> filesDeleted = new THashSet<>(FileUtil.FILE_HASHING_STRATEGY);
for (VFileEvent event : events) {
if (event instanceof VFileDeleteEvent || event instanceof VFileMoveEvent) {
final VirtualFile file = event.getFile();
@@ -127,12 +119,15 @@ public class TranslatingCompilerFilesMonitor implements BulkFileListener {
}
}
}
notifyFilesDeleted(filesDeleted);
return new ChangeApplier() {
@Override
public void afterVfsChange() {
after(events, filesDeleted);
}
};
}
@Override
public void after(@NotNull List<? extends VFileEvent> events) {
final Set<File> filesDeleted = new THashSet<>(FileUtil.FILE_HASHING_STRATEGY);
private static void after(@NotNull List<? extends VFileEvent> events, Set<File> filesDeleted) {
final Set<File> filesChanged = new THashSet<>(FileUtil.FILE_HASHING_STRATEGY);
for (VFileEvent event : events) {
if (event instanceof VFilePropertyChangeEvent) {
@@ -147,7 +142,7 @@ public class TranslatingCompilerFilesMonitor implements BulkFileListener {
}
// If a file name differs ony in case, on case-insensitive file systems such name still denotes the same file.
// In this situation filesDeleted and filesChanged sets will contain paths wchich are different only in case.
// In this situation filesDeleted and filesChanged sets will contain paths which are different only in case.
// Thus the order in which BuildManager is notified, is important:
// first deleted paths notification and only then changed paths notification
notifyFilesDeleted(filesDeleted);
@@ -235,15 +230,15 @@ public class TranslatingCompilerFilesMonitor implements BulkFileListener {
FileUtil.isAncestor(PathManager.getConfigPath(), file.getPath(), false); // is config file
}
private void notifyFilesChanged(@NotNull Collection<? extends File> paths) {
private static void notifyFilesChanged(@NotNull Collection<? extends File> paths) {
if (!paths.isEmpty()) {
myBuildManager.notifyFilesChanged(paths);
BuildManager.getInstance().notifyFilesChanged(paths);
}
}
private void notifyFilesDeleted(@NotNull Collection<? extends File> paths) {
private static void notifyFilesDeleted(@NotNull Collection<? extends File> paths) {
if (!paths.isEmpty()) {
myBuildManager.notifyFilesDeleted(paths);
BuildManager.getInstance().notifyFilesDeleted(paths);
}
}
}

View File

@@ -1,4 +1,4 @@
// 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.
// Copyright 2000-2019 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.compiler.impl.javaCompiler;
import com.intellij.compiler.options.ModuleOptionsTableModel;
@@ -9,6 +9,7 @@ import com.intellij.ui.TableSpeedSearch;
import com.intellij.ui.TableUtil;
import com.intellij.ui.ToolbarDecorator;
import com.intellij.ui.components.fields.ExpandableTextField;
import com.intellij.ui.scale.JBUIScale;
import com.intellij.ui.table.JBTable;
import com.intellij.util.ui.JBUI;
import org.jetbrains.annotations.NotNull;
@@ -30,7 +31,7 @@ public class CompilerModuleOptionsComponent extends JPanel {
myProject = project;
myTable = new JBTable(new ModuleOptionsTableModel());
myTable.setRowHeight(JBUI.scale(22));
myTable.setRowHeight(JBUIScale.scale(22));
myTable.getEmptyText().setText("Additional compilation options will be the same for all modules");
TableColumn moduleColumn = myTable.getColumnModel().getColumn(0);

View File

@@ -22,10 +22,10 @@ import com.intellij.ui.Gray;
import com.intellij.ui.JBColor;
import com.intellij.ui.RawCommandLineEditor;
import com.intellij.ui.components.JBLabel;
import com.intellij.ui.scale.JBUIScale;
import com.intellij.util.containers.ContainerUtil;
import com.intellij.util.containers.ContainerUtilRt;
import com.intellij.util.execution.ParametersListUtil;
import com.intellij.util.ui.JBUI;
import com.intellij.xml.util.XmlStringUtil;
import org.jetbrains.annotations.NotNull;
@@ -331,6 +331,6 @@ public class CompilerUIConfigurable implements SearchableConfigurable, Configura
myResourcePatternsField = new RawCommandLineEditor(ParametersListUtil.COLON_LINE_PARSER, ParametersListUtil.COLON_LINE_JOINER);
myResourcePatternsField.setDialogCaption("Resource patterns");
myHeapSizeField = new JTextField();
myHeapSizeField.setPreferredSize(new Dimension(JBUI.scale(50), myHeapSizeField.getPreferredSize().height));
myHeapSizeField.setPreferredSize(new Dimension(JBUIScale.scale(50), myHeapSizeField.getPreferredSize().height));
}
}

View File

@@ -9,6 +9,7 @@ import com.intellij.ui.TableSpeedSearch;
import com.intellij.ui.TableUtil;
import com.intellij.ui.ToolbarDecorator;
import com.intellij.ui.components.JBTextField;
import com.intellij.ui.scale.JBUIScale;
import com.intellij.ui.table.JBTable;
import com.intellij.util.ArrayUtilRt;
import com.intellij.util.ObjectUtils;
@@ -57,7 +58,7 @@ public class TargetOptionsComponent extends JPanel {
myCbProjectTargetLevel = createTargetOptionsCombo();
myTable = new JBTable(new ModuleOptionsTableModel());
myTable.setRowHeight(JBUI.scale(22));
myTable.setRowHeight(JBUIScale.scale(22));
myTable.getEmptyText().setText("All modules will be compiled with project bytecode version");
TableColumn moduleColumn = myTable.getColumnModel().getColumn(0);

View File

@@ -1,24 +1,10 @@
/*
* Copyright 2000-2009 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-2019 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.deployment;
import com.intellij.openapi.compiler.CompilerBundle;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.util.io.FileUtil;
import com.intellij.openapi.vfs.VfsUtil;
import com.intellij.openapi.vfs.VfsUtilCore;
import com.intellij.psi.PsiFile;
import com.intellij.psi.xml.XmlDocument;
import com.intellij.psi.xml.XmlFile;
@@ -55,7 +41,7 @@ public class DeploymentUtilImpl extends DeploymentUtil {
@Nullable
public String getConfigFileErrorMessage(final ConfigFile configFile) {
if (configFile.getVirtualFile() == null) {
String path = FileUtil.toSystemDependentName(VfsUtil.urlToPath(configFile.getUrl()));
String path = FileUtil.toSystemDependentName(VfsUtilCore.urlToPath(configFile.getUrl()));
return CompilerBundle.message("mesage.text.deployment.descriptor.file.not.exist", path);
}
PsiFile psiFile = configFile.getPsiFile();
@@ -66,7 +52,8 @@ public class DeploymentUtilImpl extends DeploymentUtil {
if (psiFile instanceof XmlFile) {
XmlDocument document = ((XmlFile)psiFile).getDocument();
if (document == null || document.getRootTag() == null) {
return CompilerBundle.message("message.text.xml.file.invalid", FileUtil.toSystemDependentName(VfsUtil.urlToPath(configFile.getUrl())));
return CompilerBundle.message("message.text.xml.file.invalid", FileUtil.toSystemDependentName(
VfsUtilCore.urlToPath(configFile.getUrl())));
}
}
return null;

View File

@@ -1,18 +1,4 @@
/*
* 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-2019 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.packaging.impl.elements;
import com.intellij.CommonBundle;
@@ -38,6 +24,7 @@ import com.intellij.openapi.util.Ref;
import com.intellij.openapi.util.io.FileUtil;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.openapi.vfs.VfsUtil;
import com.intellij.openapi.vfs.VfsUtilCore;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.packaging.artifacts.ArtifactType;
import com.intellij.packaging.elements.CompositePackagingElement;
@@ -143,7 +130,7 @@ public class ManifestFileUtil {
if (file != null) {
for (VirtualFile contentRoot : contentRoots) {
if (VfsUtil.isAncestor(contentRoot, file, false)) {
if (VfsUtilCore.isAncestor(contentRoot, file, false)) {
return contentRoot;
}
}

View File

@@ -85,6 +85,10 @@ public class InstrumentationClassFinder {
@Override
protected Class findClass(String name) throws ClassNotFoundException {
Class aClass = InstrumentationClassFinder.this.findClass(name);
if (aClass != null) {
return aClass;
}
final InputStream is = lookupClassBeforeClasspath(name.replace('.', '/'));
if (is == null) {
throw new ClassNotFoundException("Class not found: " + name.replace('/', '.')); // ensure presentable class name in error message
@@ -106,6 +110,10 @@ public class InstrumentationClassFinder {
return loader;
}
protected Class findClass(String name) {
return null;
}
public void releaseResources() {
myPlatformClasspath.releaseResources();
myClasspath.releaseResources();

View File

@@ -1,18 +1,4 @@
/*
* Copyright 2000-2009 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-2019 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.compiler.ant;
@@ -22,7 +8,7 @@ import com.intellij.openapi.project.Project;
import com.intellij.openapi.projectRoots.Sdk;
import com.intellij.openapi.roots.ModuleRootManager;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.openapi.vfs.VfsUtil;
import com.intellij.openapi.vfs.VfsUtilCore;
import com.intellij.openapi.vfs.VirtualFile;
import org.jetbrains.annotations.NonNls;
@@ -213,7 +199,7 @@ public abstract class BuildProperties extends CompositeGenerator {
public static File getProjectBaseDir(final Project project) {
final VirtualFile baseDir = project.getBaseDir();
assert baseDir != null;
return VfsUtil.virtualToIoFile(baseDir);
return VfsUtilCore.virtualToIoFile(baseDir);
}
/**

View File

@@ -1,25 +1,11 @@
/*
* 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-2019 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.compiler.options;
import com.intellij.openapi.Disposable;
import com.intellij.openapi.util.Comparing;
import com.intellij.openapi.util.io.FileUtil;
import com.intellij.openapi.vfs.VfsUtil;
import com.intellij.openapi.vfs.VfsUtilCore;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.openapi.vfs.pointers.VirtualFilePointer;
import com.intellij.openapi.vfs.pointers.VirtualFilePointerManager;
@@ -47,7 +33,7 @@ public class ExcludeEntryDescription implements Disposable {
}
void setPresentableUrl(String newUrl) {
myFilePointer = VirtualFilePointerManager.getInstance().create(VfsUtil.pathToUrl(FileUtil.toSystemIndependentName(newUrl)), myParentDisposable, null);
myFilePointer = VirtualFilePointerManager.getInstance().create(VfsUtilCore.pathToUrl(FileUtil.toSystemIndependentName(newUrl)), myParentDisposable, null);
final VirtualFile file = getVirtualFile();
if (file != null) {
myIsFile = !file.isDirectory();

View File

@@ -1,3 +1,4 @@
// Copyright 2000-2019 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.compiler.artifacts;
import com.intellij.compiler.BaseCompilerTestCase;
@@ -7,7 +8,7 @@ import com.intellij.openapi.roots.libraries.Library;
import com.intellij.openapi.util.io.FileUtil;
import com.intellij.openapi.vfs.JarFileSystem;
import com.intellij.openapi.vfs.LocalFileSystem;
import com.intellij.openapi.vfs.VfsUtil;
import com.intellij.openapi.vfs.VfsUtilCore;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.packaging.artifacts.Artifact;
import com.intellij.packaging.artifacts.ArtifactType;
@@ -102,7 +103,7 @@ public abstract class ArtifactCompilerTestCase extends BaseCompilerTestCase {
public static void assertOutput(Artifact artifact, TestFileSystemBuilder item) {
final VirtualFile outputFile = getOutputDir(artifact);
outputFile.refresh(false, true);
item.build().assertDirectoryEqual(VfsUtil.virtualToIoFile(outputFile));
item.build().assertDirectoryEqual(VfsUtilCore.virtualToIoFile(outputFile));
}
protected static VirtualFile getOutputDir(Artifact artifact) {

View File

@@ -3,7 +3,7 @@ package com.intellij.debugger.impl;
import com.intellij.openapi.editor.Document;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.editor.ex.util.CaretVisualPositionKeeper;
import com.intellij.openapi.editor.ex.util.EditorScrollingPositionKeeper;
import com.intellij.openapi.fileEditor.FileEditor;
import com.intellij.openapi.fileEditor.FileEditorManager;
import com.intellij.openapi.fileEditor.TextEditor;
@@ -40,11 +40,11 @@ public class JavaDebuggerInlayUtil {
Document document = editor.getDocument();
int startLine = document.getLineNumber(lBrace.getTextOffset());
int endLine = document.getLineNumber(rBrace.getTextOffset());
CaretVisualPositionKeeper keeper = new CaretVisualPositionKeeper(editor);
for (int i = startLine; i < endLine; i++) {
XDebuggerInlayUtil.createBlockInlay(editor, document.getLineStartOffset(i));
}
keeper.restoreOriginalLocation(true);
EditorScrollingPositionKeeper.perform(editor, true, () -> {
for (int i = startLine; i < endLine; i++) {
XDebuggerInlayUtil.createBlockInlay(editor, document.getLineStartOffset(i));
}
});
}
@Override
@@ -66,9 +66,7 @@ public class JavaDebuggerInlayUtil {
}
if (editor != currentEditor || method != currentMethod) {
if (currentEditor != null) {
CaretVisualPositionKeeper keeper = new CaretVisualPositionKeeper(editor);
XDebuggerInlayUtil.clearBlockInlays(currentEditor);
keeper.restoreOriginalLocation(true);
EditorScrollingPositionKeeper.perform(editor, true, () -> XDebuggerInlayUtil.clearBlockInlays(currentEditor));
}
if (editor != null) setupValuePlaceholders(editor, method);
currentEditor = editor;

View File

@@ -48,6 +48,8 @@ import org.jetbrains.jps.model.java.JdkVersionDetector;
import javax.swing.event.HyperlinkEvent;
import javax.swing.event.HyperlinkListener;
import java.io.File;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Comparator;
import java.util.List;
import java.util.concurrent.ExecutionException;
@@ -84,7 +86,7 @@ public class MemoryAgentUtil {
ParametersList parametersList = parameters.getVMParametersList();
if (parametersList.getParameters().stream().anyMatch(x -> x.contains("memory_agent"))) return;
boolean isInDebugMode = Registry.is("debugger.memory.agent.debug");
File agentFile = null;
Path agentFile = null;
String errorMessage = null;
long start = System.currentTimeMillis();
try {
@@ -109,8 +111,8 @@ public class MemoryAgentUtil {
}
LOG.info("Memory agent extracting took " + (System.currentTimeMillis() - start) + " ms");
String agentFileName = agentFile.getName();
String path = JavaExecutionUtil.handleSpacesInAgentPath(agentFile.getAbsolutePath(), "debugger-memory-agent",
String agentFileName = agentFile.getFileName().toString();
String path = JavaExecutionUtil.handleSpacesInAgentPath(agentFile.toAbsolutePath().toString(), "debugger-memory-agent",
MEMORY_AGENT_EXTRACT_DIRECTORY, f -> agentFileName.equals(f.getName()));
if (path == null) {
return;
@@ -181,13 +183,13 @@ public class MemoryAgentUtil {
return vendor != null && StringUtil.containsIgnoreCase(vendor, "ibm");
}
private static File getAgentFile(boolean isInDebugMode, String jdkPath)
private static Path getAgentFile(boolean isInDebugMode, String jdkPath)
throws InterruptedException, ExecutionException, TimeoutException {
if (isInDebugMode) {
String debugAgentPath = Registry.get("debugger.memory.agent.debug.path").asString();
if (!debugAgentPath.isEmpty()) {
LOG.info("Local memory agent will be used: " + debugAgentPath);
return new File(debugAgentPath);
return Paths.get(debugAgentPath);
}
}

View File

@@ -1,18 +1,4 @@
/*
* 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-2019 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.debugger.memory.ui;
import com.intellij.debugger.memory.filtering.FilteringResult;

View File

@@ -1,4 +1,4 @@
// 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.
// Copyright 2000-2019 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.debugger.memory.ui;
import com.intellij.debugger.DebuggerManager;
@@ -9,7 +9,6 @@ import com.intellij.debugger.engine.SuspendContextImpl;
import com.intellij.debugger.engine.evaluation.EvaluationContext;
import com.intellij.debugger.engine.evaluation.EvaluationContextImpl;
import com.intellij.debugger.engine.events.DebuggerContextCommandImpl;
import com.intellij.debugger.memory.agent.MemoryAgent;
import com.intellij.debugger.memory.agent.MemoryAgentUtil;
import com.intellij.debugger.memory.filtering.FilteringResult;
import com.intellij.debugger.memory.filtering.FilteringTask;
@@ -30,6 +29,7 @@ import com.intellij.openapi.wm.IdeFocusManager;
import com.intellij.ui.DoubleClickListener;
import com.intellij.ui.components.JBLabel;
import com.intellij.ui.components.JBPanel;
import com.intellij.ui.scale.JBUIScale;
import com.intellij.util.containers.ContainerUtil;
import com.intellij.util.ui.JBUI;
import com.intellij.util.ui.UIUtil;
@@ -82,7 +82,7 @@ class InstancesView extends InstancesViewBase {
private volatile MyFilteringWorker myFilteringTask = null;
InstancesView(@NotNull XDebugSession session, InstancesProvider instancesProvider, String className, Consumer<? super String> warningMessageConsumer) {
super(new BorderLayout(0, JBUI.scale(BORDER_LAYOUT_DEFAULT_GAP)), session, instancesProvider);
super(new BorderLayout(0, JBUIScale.scale(BORDER_LAYOUT_DEFAULT_GAP)), session, instancesProvider);
myClassName = className;
myDebugProcess = (DebugProcessImpl) (DebuggerManager.getInstance(session.getProject()).getDebugProcess(session.getDebugProcess().getProcessHandler()));
myNodeManager = new MyNodeManager(session.getProject());
@@ -94,11 +94,11 @@ class InstancesView extends InstancesViewBase {
editorsProvider, this);
final Dimension filteringButtonSize = myFilterConditionEditor.getEditorComponent().getPreferredSize();
filteringButtonSize.width = JBUI.scale(FILTERING_BUTTON_ADDITIONAL_WIDTH) +
getFilterButton().getPreferredSize().width;
filteringButtonSize.width = JBUIScale.scale(FILTERING_BUTTON_ADDITIONAL_WIDTH) +
getFilterButton().getPreferredSize().width;
getFilterButton().setPreferredSize(filteringButtonSize);
final JBPanel filteringPane = new JBPanel(new BorderLayout(JBUI.scale(BORDER_LAYOUT_DEFAULT_GAP), 0));
final JBPanel filteringPane = new JBPanel(new BorderLayout(JBUIScale.scale(BORDER_LAYOUT_DEFAULT_GAP), 0));
final JBLabel sideEffectsWarning = new JBLabel("Warning: filtering may have side effects", SwingConstants.RIGHT);
sideEffectsWarning.setBorder(JBUI.Borders.emptyTop(1));
sideEffectsWarning.setComponentStyle(UIUtil.ComponentStyle.SMALL);

View File

@@ -1,4 +1,4 @@
// 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.
// Copyright 2000-2019 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.debugger.ui.impl;
import com.intellij.debugger.engine.evaluation.EvaluateException;
@@ -149,7 +149,7 @@ public class DebuggerTreeRenderer extends ColoredTreeCellRenderer {
final Icon valueIcon = valueDescriptor.getValueIcon();
if (nodeIcon != null && valueIcon != null) {
nodeIcon = new RowIcon(nodeIcon, valueIcon);
nodeIcon = IconManager.getInstance().createRowIcon(nodeIcon, valueIcon);
}
return nodeIcon;
}

View File

@@ -2,17 +2,23 @@
package com.intellij.debugger.memory.agent.extractor
import com.intellij.openapi.util.io.FileUtil
import org.apache.commons.io.FileUtils
import com.intellij.openapi.util.io.FileUtilRt
import java.io.File
import java.io.FileNotFoundException
import java.nio.file.Files
import java.nio.file.Path
class AgentExtractor {
fun extract(agentType: AgentLibraryType, directory: File): File {
val file = FileUtil.createTempFile(directory, "${agentType.prefix}memory_agent", agentType.suffix, true)
fun extract(agentType: AgentLibraryType, directory: File): Path {
Files.createTempFile(directory.toPath(), "${agentType.prefix}memory_agent", agentType.suffix)
val file = FileUtilRt.createTempFile(directory, "${agentType.prefix}memory_agent", agentType.suffix, true).toPath()
val agentFileName = "${agentType.prefix}memory_agent${agentType.suffix}"
val inputStream = AgentExtractor::class.java.classLoader.getResourceAsStream("bin/$agentFileName")
if (inputStream == null) throw FileNotFoundException(agentFileName)
FileUtils.copyToFile(inputStream, file)
val inputStream = AgentExtractor::class.java.classLoader.getResourceAsStream("bin/$agentFileName") ?: throw FileNotFoundException(agentFileName)
inputStream.use { input ->
Files.newOutputStream(file).use { output ->
FileUtil.copy(input, output)
}
}
return file
}

View File

@@ -8,13 +8,12 @@ import com.intellij.execution.configurations.RunConfigurationModule;
import com.intellij.execution.dashboard.RunDashboardCustomizer;
import com.intellij.execution.dashboard.RunDashboardRunConfigurationNode;
import com.intellij.execution.ui.RunContentDescriptor;
import com.intellij.pom.Navigatable;
import com.intellij.psi.PsiClass;
import com.intellij.util.PsiNavigateUtil;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.awt.event.MouseEvent;
public class CommonJavaRunDashboardCustomizer extends RunDashboardCustomizer {
@Override
public boolean isApplicable(@NotNull RunnerAndConfigurationSettings settings, @Nullable RunContentDescriptor descriptor) {
@@ -26,12 +25,27 @@ public class CommonJavaRunDashboardCustomizer extends RunDashboardCustomizer {
}
@Override
public boolean handleDoubleClick(@NotNull MouseEvent event, @NotNull RunDashboardRunConfigurationNode node) {
@Nullable
public Navigatable getNavigatable(@NotNull RunDashboardRunConfigurationNode node) {
PsiClass mainClass = findMainClass(node.getConfigurationSettings().getConfiguration());
if (mainClass == null || !mainClass.isValid()) return false;
if (mainClass == null || !mainClass.isValid()) return null;
PsiNavigateUtil.navigate(mainClass);
return true;
return new Navigatable() {
@Override
public void navigate(boolean requestFocus) {
PsiNavigateUtil.navigate(mainClass, requestFocus);
}
@Override
public boolean canNavigate() {
return true;
}
@Override
public boolean canNavigateToSource() {
return true;
}
};
}
@Nullable

View File

@@ -1,11 +1,8 @@
/*
* 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-2019 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.execution.scratch;
import com.intellij.application.options.ModuleDescriptionsComboBox;
import com.intellij.execution.ExecutionBundle;
import com.intellij.execution.JavaExecutionUtil;
import com.intellij.execution.ui.*;
import com.intellij.ide.scratch.ScratchFileService;
import com.intellij.ide.scratch.ScratchRootType;
@@ -22,6 +19,7 @@ import com.intellij.openapi.vfs.LocalFileSystem;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.ui.PanelWithAnchor;
import com.intellij.ui.components.JBCheckBox;
import com.intellij.util.ui.JBInsets;
import com.intellij.util.ui.JBUI;
import com.intellij.util.ui.UIUtil;
import org.jetbrains.annotations.NotNull;
@@ -103,7 +101,7 @@ public class JavaScratchConfigurable extends SettingsEditor<JavaScratchConfigura
myWholePanel = new JPanel(new GridBagLayout());
myWholePanel.add(myMainClass, new GridBagConstraints(0, 0, 1, 1, 1.0, 0.0, NORTHWEST, HORIZONTAL, JBUI.insetsTop(6), 0, 0 ));
myWholePanel.add(myScratchPathField, new GridBagConstraints(RELATIVE, 1, 1, 1, 1.0, 0.0, NORTHWEST, HORIZONTAL, JBUI.insetsTop(6), 0, 0 ));
myWholePanel.add(myCommonProgramParameters, new GridBagConstraints(RELATIVE, 2, 1, 1, 1.0, 1.0, NORTHWEST, BOTH, JBUI.insets(12, 0), 0, 0 ));
myWholePanel.add(myCommonProgramParameters, new GridBagConstraints(RELATIVE, 2, 1, 1, 1.0, 1.0, NORTHWEST, BOTH, JBInsets.create(12, 0), 0, 0 ));
myWholePanel.add(myModule, new GridBagConstraints(RELATIVE, 3, 1, 1, 1.0, 0.0, NORTHWEST, HORIZONTAL, JBUI.emptyInsets(), 0, 0 ));
myWholePanel.add(myIncludeProvidedDeps, new GridBagConstraints(RELATIVE, 4, 1, 1, 1.0, 0.0, NORTHWEST, HORIZONTAL, JBUI.insetsTop(6), 0, 0 ));
myWholePanel.add(myJrePathEditor, new GridBagConstraints(RELATIVE, 5, 1, 1, 1.0, 0.0, NORTHWEST, HORIZONTAL, JBUI.insetsTop(12), 0, 0 ));

View File

@@ -241,8 +241,8 @@ public class ShowAffectedTestsAction extends AnAction {
}
public static boolean isEnabled(@Nullable Project project) {
if (project == null || DumbService.isDumb(project)) return false;
return Registry.is(TestDiscoveryExtension.TEST_DISCOVERY_REGISTRY_KEY) || ApplicationManager.getApplication().isInternal();
return project != null &&
(Registry.is(TestDiscoveryExtension.TEST_DISCOVERY_REGISTRY_KEY) || ApplicationManager.getApplication().isInternal());
}
@NotNull

View File

@@ -1,4 +1,4 @@
// 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.
// Copyright 2000-2019 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.execution.ui;
import com.intellij.execution.CommonJavaRunConfigurationParameters;
@@ -15,7 +15,7 @@ import com.intellij.openapi.util.text.StringUtil;
import com.intellij.ui.PanelWithAnchor;
import com.intellij.ui.RawCommandLineEditor;
import com.intellij.ui.components.JBCheckBox;
import com.intellij.util.ui.JBUI;
import com.intellij.ui.scale.JBUIScale;
import com.intellij.util.ui.UIUtil;
import org.jetbrains.annotations.Nullable;
@@ -109,7 +109,7 @@ public class CommonJavaParametersPanel extends CommonProgramParametersPanel {
private final TextFieldWithBrowseButton myInputFile = new TextFieldWithBrowseButton();
RedirectInputPanel() {
super(new BorderLayout(JBUI.scale(10), JBUI.scale(2)));
super(new BorderLayout(JBUIScale.scale(10), JBUIScale.scale(2)));
myInputFile.addBrowseFolderListener(null, null, null,
FileChooserDescriptorFactory.createSingleFileDescriptor(),
TextComponentAccessor.TEXT_FIELD_WHOLE_TEXT);

View File

@@ -17,6 +17,7 @@ package com.intellij.execution.ui;
import com.intellij.execution.ExecutionBundle;
import com.intellij.openapi.actionSystem.*;
import com.intellij.openapi.actionSystem.ex.ActionUtil;
import com.intellij.openapi.ide.CopyPasteManager;
import com.intellij.openapi.ui.FixedSizeButton;
import com.intellij.ui.PopupHandler;
@@ -84,7 +85,7 @@ public class ConfigurationArgumentsHelpArea extends JPanel {
private class MyCopyAction extends AnAction {
MyCopyAction() {
super(ExecutionBundle.message("run.configuration.arguments.help.panel.copy.action.name"));
copyFrom(ActionManager.getInstance().getAction(IdeActions.ACTION_COPY));
ActionUtil.copyFrom(this, IdeActions.ACTION_COPY);
}
@Override

View File

@@ -17,7 +17,7 @@ import com.intellij.openapi.util.text.StringUtil;
import com.intellij.ui.*;
import com.intellij.ui.components.JBTextField;
import com.intellij.ui.components.fields.ExtendableTextField;
import com.intellij.util.ui.JBUI;
import com.intellij.util.ui.JBInsets;
import com.intellij.util.ui.StatusText;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -93,7 +93,7 @@ public class JrePathEditor extends LabeledComponent<ComboBox> implements PanelWi
comboBox.setEditable(true);
comboBox.setRenderer(new ColoredListCellRenderer<JreComboBoxItem>() {
{
setIpad(JBUI.insets(1, 0));
setIpad(JBInsets.create(1, 0));
setMyBorder(null);
}

View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/resources" type="java-resource" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module" module-name="intellij.platform.resources" scope="RUNTIME" />
</component>
</module>

View File

@@ -22,9 +22,6 @@
<xi:include href="/META-INF/RemoteServers.xml" xpointer="xpointer(/idea-plugin/*)">
<xi:fallback/>
</xi:include>
<xi:include href="/META-INF/RemoteServersJava.xml" xpointer="xpointer(/idea-plugin/*)">
<xi:fallback/>
</xi:include>
<xi:include href="/META-INF/DesignerCorePlugin.xml" xpointer="xpointer(/idea-plugin/*)">
<xi:fallback/>
</xi:include>
@@ -46,9 +43,6 @@
<xi:include href="/META-INF/structuralsearch.xml" xpointer="xpointer(/idea-plugin/*)">
<xi:fallback/>
</xi:include>
<xi:include href="/META-INF/structuralsearch-java.xml" xpointer="xpointer(/idea-plugin/*)">
<xi:fallback/>
</xi:include>
<xi:include href="/META-INF/coverage-common-plugin.xml" xpointer="xpointer(/idea-plugin/*)"/>
<module value="com.intellij.modules.externalSystem"/>
@@ -81,16 +75,6 @@
id="Template Data Languages" key="template.data.language.configurable" bundle="messages.LangBundle"
nonDefaultProject="true"/>
<!-- Application Configurables -->
<!-- Path Variables -->
<!-- the implementation of this configurable is in intellij.platform.ide.impl but it's not registered in platform because
it's only required in full IDEA -->
<applicationConfigurable groupId="appearance" groupWeight="-10"
instance="com.intellij.application.options.pathMacros.PathMacroConfigurable" id="preferences.pathVariables"
key="title.path.variables" bundle="messages.ApplicationBundle"/>
<editorNotificationProvider implementation="com.intellij.codeInsight.daemon.impl.SdkSetupNotificationProvider"/>
<vcsAwareCheckoutListener implementation="com.intellij.openapi.vcs.checkout.RegisterMappingCheckoutListener"/>
@@ -174,7 +158,8 @@
<add-to-group group-id="ToolsBasicGroup" anchor="after" relative-to-action="SaveFileAsTemplate"/>
</group>
<action id="ConsoleView.FoldLinesLikeThis" class="com.intellij.execution.console.FoldLinesLikeThis" text="Fold Lines Like This">
<add-to-group group-id="ConsoleEditorPopupMenu" anchor="after" relative-to-action="$SearchWeb"/>
</action>
</actions>
<xi:include href="/META-INF/JavaPlugin.xml" xpointer="xpointer(/idea-plugin/*)"/>
</idea-plugin>

View File

@@ -1,18 +1,4 @@
/*
* Copyright 2000-2014 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-2019 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.facet.impl.ui.libraries;
@@ -30,7 +16,7 @@ import com.intellij.openapi.roots.OrderRootType;
import com.intellij.openapi.roots.libraries.Library;
import com.intellij.openapi.roots.ui.configuration.libraries.AddCustomLibraryDialog;
import com.intellij.openapi.roots.ui.configuration.libraries.CustomLibraryDescription;
import com.intellij.openapi.vfs.VfsUtil;
import com.intellij.openapi.vfs.VfsUtilCore;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.util.containers.ContainerUtil;
import org.jetbrains.annotations.NotNull;
@@ -82,7 +68,7 @@ public class FacetLibrariesValidatorImpl extends FacetLibrariesValidator {
}
List<VirtualFile> roots = collectRoots(myContext.getRootModel());
RequiredLibrariesInfo.RequiredClassesNotFoundInfo info = myRequiredLibraries.checkLibraries(VfsUtil.toVirtualFileArray(roots));
RequiredLibrariesInfo.RequiredClassesNotFoundInfo info = myRequiredLibraries.checkLibraries(VfsUtilCore.toVirtualFileArray(roots));
if (info == null) {
return ValidationResult.OK;
}

View File

@@ -1,10 +1,10 @@
// 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.
// Copyright 2000-2019 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.ide.projectView.actions;
import com.intellij.application.options.ModulesComboBox;
import com.intellij.openapi.application.WriteAction;
import com.intellij.openapi.module.Module;
import com.intellij.openapi.module.ModuleUtil;
import com.intellij.openapi.module.ModuleUtilCore;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.roots.ModifiableRootModel;
import com.intellij.openapi.roots.ModuleRootManager;
@@ -97,10 +97,10 @@ public class CreateLibraryFromFilesDialog extends DialogWrapper {
Module module = null;
final VirtualFile local = JarFileSystem.getInstance().getVirtualFileForJar(root.getFile());
if (local != null) {
module = ModuleUtil.findModuleForFile(local, myProject);
module = ModuleUtilCore.findModuleForFile(local, myProject);
}
if (module == null) {
module = ModuleUtil.findModuleForFile(root.getFile(), myProject);
module = ModuleUtilCore.findModuleForFile(root.getFile(), myProject);
}
if (module != null) {
return module;

View File

@@ -712,16 +712,16 @@ public class ProjectTypeStep extends ModuleWizardStep implements SettingsStep, D
reportStatistics("attempt");
}
private void reportStatistics(String groupId) {
private void reportStatistics(String eventId) {
TemplatesGroup group = myProjectTypeList.getSelectedValue();
FeatureUsageData data = new FeatureUsageData();
data.addData("projectType", group.isSafeToReport() ? group.getId() : "third-party");
myFrameworksPanel.reportFeatureUsageData(data);
data.addData("projectType", group.isSafeToReport() ? group.getId() : "third.party");
myFrameworksPanel.reportSelectedFrameworks(eventId, data);
ModuleWizardStep step = getCustomStep();
if (step instanceof StatisticsAwareModuleWizardStep) {
((StatisticsAwareModuleWizardStep) step).reportFeatureUsageData(data);
((StatisticsAwareModuleWizardStep) step).addCustomFeatureUsageData(eventId, data);
}
FUCounterUsageLogger.getInstance().logEvent("new.project.wizard", groupId, data);
FUCounterUsageLogger.getInstance().logEvent("new.project.wizard", eventId, data);
}
}

View File

@@ -1,4 +1,4 @@
// 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.
// Copyright 2000-2019 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.ide.util.importProject;
import com.intellij.facet.Facet;
@@ -10,7 +10,7 @@ import com.intellij.framework.detection.impl.FrameworkDetectionContextBase;
import com.intellij.openapi.util.Pair;
import com.intellij.openapi.util.io.FileUtil;
import com.intellij.openapi.vfs.LocalFileSystem;
import com.intellij.openapi.vfs.VfsUtil;
import com.intellij.openapi.vfs.VfsUtilCore;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.util.containers.MultiMap;
import org.jetbrains.annotations.NotNull;
@@ -33,7 +33,7 @@ public abstract class FrameworkDetectionInWizardContext extends FrameworkDetecti
final List<ModuleDescriptor> descriptors = getModuleDescriptors();
MultiMap<ModuleDescriptor, VirtualFile> filesByModule = new MultiMap<>();
for (VirtualFile file : files) {
final File ioFile = VfsUtil.virtualToIoFile(file);
final File ioFile = VfsUtilCore.virtualToIoFile(file);
ModuleDescriptor descriptor = findDescriptorByFile(descriptors, ioFile);
if (descriptor != null) {
filesByModule.putValue(descriptor, file);

View File

@@ -1,18 +1,4 @@
/*
* 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-2019 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.ide.util.importProject;
import com.intellij.ide.IdeBundle;
@@ -24,6 +10,7 @@ import com.intellij.ide.util.projectWizard.importSources.impl.ProjectFromSources
import com.intellij.openapi.application.ApplicationNamesInfo;
import com.intellij.openapi.ui.MultiLineLabelUI;
import com.intellij.openapi.ui.ex.MultiLineLabel;
import com.intellij.util.ui.JBInsets;
import com.intellij.util.ui.JBUI;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.Nullable;
@@ -76,7 +63,7 @@ public class RootsDetectionStep extends AbstractStepWithProgress<List<DetectedRo
GridBagConstraints.HORIZONTAL, JBUI.insets(8, 10, 0, 10), 0, 0));
panel.add(myDetectedRootsChooser.getComponent(),
new GridBagConstraints(0, GridBagConstraints.RELATIVE, 2, 1, 1.0, 1.0, GridBagConstraints.NORTHWEST, GridBagConstraints.BOTH,
JBUI.insets(8, 10), 0, 0));
JBInsets.create(8, 10), 0, 0));
final JButton markAllButton = new JButton(IdeBundle.message("button.mark.all"));
panel.add(markAllButton,

View File

@@ -16,6 +16,7 @@ import com.intellij.ide.util.frameworkSupport.FrameworkSupportUtil;
import com.intellij.ide.util.newProjectWizard.impl.FrameworkSupportCommunicator;
import com.intellij.ide.util.newProjectWizard.impl.FrameworkSupportModelBase;
import com.intellij.internal.statistic.eventLog.FeatureUsageData;
import com.intellij.internal.statistic.service.fus.collectors.FUCounterUsageLogger;
import com.intellij.internal.statistic.utils.PluginInfoDetectorKt;
import com.intellij.openapi.Disposable;
import com.intellij.openapi.diagnostic.Logger;
@@ -460,13 +461,13 @@ public class AddSupportForFrameworksPanel implements Disposable {
Collections.sort(nodes, (o1, o2) -> comparator.compare(o1.getUserObject(), o2.getUserObject()));
}
public void reportFeatureUsageData(FeatureUsageData data) {
public void reportSelectedFrameworks(@NotNull String eventId, @NotNull FeatureUsageData original) {
List<FrameworkSupportNode> nodes = getSelectedNodes();
for (int i = 0; i < nodes.size(); i++) {
FrameworkSupportNode node = nodes.get(i);
for (FrameworkSupportNode node : nodes) {
FrameworkSupportInModuleProvider provider = node.getUserObject();
String id = PluginInfoDetectorKt.getPluginInfo(provider.getClass()).isSafeToReport() ? provider.getId() : "third-party";
data.addData("framework" + i, id);
final FeatureUsageData data = original.copy();
data.addData("framework", PluginInfoDetectorKt.getPluginInfo(provider.getClass()).isSafeToReport() ? provider.getId() : "third.party");
FUCounterUsageLogger.getInstance().logEvent("new.project.wizard", eventId + ".add.framework", data);
}
}
}

View File

@@ -1,4 +1,4 @@
// 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.
// Copyright 2000-2019 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.ide.util.newProjectWizard;
import com.intellij.CommonBundle;
@@ -26,6 +26,7 @@ import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.openapi.wm.IdeFocusManager;
import com.intellij.ui.DocumentAdapter;
import com.intellij.ui.FieldPanel;
import com.intellij.util.ui.JBInsets;
import com.intellij.util.ui.JBUI;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
@@ -117,7 +118,7 @@ public class SourcePathsStep extends AbstractStepWithProgress<List<JavaModuleSou
final Insets borderInsets = myTfFullPath.getBorder().getBorderInsets(myTfFullPath);
myTfFullPath.setBorder(BorderFactory.createEmptyBorder(borderInsets.top, borderInsets.left, borderInsets.bottom, borderInsets.right));
panel.add(myTfFullPath, new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 1, 1.0, 0.0, GridBagConstraints.SOUTHWEST, GridBagConstraints.HORIZONTAL,
JBUI.insets(8, 10), 0, 0));
JBInsets.create(8, 10), 0, 0));
ButtonGroup group = new ButtonGroup();
group.add(myRbCreateSource);
@@ -173,7 +174,7 @@ public class SourcePathsStep extends AbstractStepWithProgress<List<JavaModuleSou
panel.add(label, new GridBagConstraints(0, GridBagConstraints.RELATIVE, 2, 1, 1.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL,
JBUI.insets(8, 10, 0, 10), 0, 0));
panel.add(mySourcePathsChooser, new GridBagConstraints(0, GridBagConstraints.RELATIVE, 2, 1, 1.0, 1.0, GridBagConstraints.NORTHWEST, GridBagConstraints.BOTH,
JBUI.insets(8, 10), 0, 0));
JBInsets.create(8, 10), 0, 0));
final JButton markAllButton = new JButton(IdeBundle.message("button.mark.all"));
panel.add(markAllButton, new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 1, 0.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE,

View File

@@ -1,18 +1,4 @@
/*
* 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-2019 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.ide.util.projectWizard;
@@ -28,6 +14,7 @@ import com.intellij.openapi.util.Ref;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.util.concurrency.SwingWorker;
import com.intellij.util.ui.JBUI;
import com.intellij.util.ui.StartupUiUtil;
import com.intellij.util.ui.UIUtil;
import com.intellij.util.ui.update.UiNotifyConnector;
import org.jetbrains.annotations.NonNls;
@@ -46,7 +33,7 @@ public abstract class AbstractStepWithProgress<Result> extends ModuleWizardStep
@NonNls private static final String PROGRESS_PANEL = "progress_panel";
@NonNls private static final String RESULTS_PANEL = "results_panel";
private JPanel myPanel;
private JLabel myTitleLabel;
private JLabel myProgressLabel;
private JLabel myProgressLabel2;
@@ -70,11 +57,11 @@ public abstract class AbstractStepWithProgress<Result> extends ModuleWizardStep
}
protected abstract JComponent createResultsPanel();
protected abstract String getProgressText();
protected abstract boolean shouldRunProgress();
protected abstract Result calculate();
protected abstract void onFinished(Result result, boolean canceled);
@@ -82,7 +69,7 @@ public abstract class AbstractStepWithProgress<Result> extends ModuleWizardStep
private JPanel createProgressPanel() {
final JPanel progressPanel = new JPanel(new GridBagLayout());
myTitleLabel = new JLabel();
myTitleLabel.setFont(UIUtil.getLabelFont().deriveFont(Font.BOLD));
myTitleLabel.setFont(StartupUiUtil.getLabelFont().deriveFont(Font.BOLD));
progressPanel.add(myTitleLabel, new GridBagConstraints(0, RELATIVE, 2, 1, 1.0, 0.0, NORTHWEST, HORIZONTAL, JBUI.insets(8, 10, 5, 10), 0, 0));
myProgressLabel = new JLabel();
@@ -119,8 +106,8 @@ public abstract class AbstractStepWithProgress<Result> extends ModuleWizardStep
private synchronized boolean isProgressRunning() {
return myProgressIndicator != null && myProgressIndicator.isRunning();
}
@Override
public void updateStep() {
if (shouldRunProgress()) {

View File

@@ -1,4 +1,4 @@
// 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.
// Copyright 2000-2019 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.ide.util.projectWizard;
import com.intellij.ide.IdeBundle;
@@ -17,7 +17,7 @@ import com.intellij.openapi.util.text.StringUtil;
import com.intellij.ui.DocumentAdapter;
import com.intellij.ui.FieldPanel;
import com.intellij.util.ui.JBUI;
import com.intellij.util.ui.UIUtil;
import com.intellij.util.ui.StartupUiUtil;
import org.jetbrains.annotations.NotNull;
import javax.swing.*;
@@ -77,7 +77,7 @@ public class NamePathComponent extends JPanel {
myTfPath.setPreferredSize(new Dimension(200, myTfPath.getPreferredSize().height));
myNameLabel = new JLabel(nameLabelText);
if (bold) myNameLabel.setFont(UIUtil.getLabelFont().deriveFont(Font.BOLD));
if (bold) myNameLabel.setFont(StartupUiUtil.getLabelFont().deriveFont(Font.BOLD));
myNameLabel.setLabelFor(myTfName);
FileChooserDescriptor chooserDescriptor = (FileChooserDescriptor)BrowseFilesListener.SINGLE_DIRECTORY_DESCRIPTOR.clone();
@@ -92,7 +92,7 @@ public class NamePathComponent extends JPanel {
myPathPanel = new FieldPanel(myTfPath, null, null, browseButtonActionListener, null);
JLabel pathLabel = new JLabel(pathLabelText);
if (bold) pathLabel.setFont(UIUtil.getLabelFont().deriveFont(Font.BOLD));
if (bold) pathLabel.setFont(StartupUiUtil.getLabelFont().deriveFont(Font.BOLD));
pathLabel.setLabelFor(myTfPath);
add(myNameLabel, new GridBagConstraints(0, RELATIVE, 1, 1, 0.0, 0.0, WEST, NONE, JBUI.insets(0, 0, 5, 4), 0, 0));

View File

@@ -1,4 +1,4 @@
// 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.
// Copyright 2000-2019 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.ide.util.projectWizard;
import com.intellij.ide.IdeBundle;
@@ -16,8 +16,9 @@ import com.intellij.openapi.roots.ui.configuration.projectRoot.JdkListConfigurab
import com.intellij.openapi.roots.ui.configuration.projectRoot.ProjectSdksModel;
import com.intellij.openapi.ui.Messages;
import com.intellij.openapi.ui.MultiLineLabelUI;
import com.intellij.util.ui.JBInsets;
import com.intellij.util.ui.JBUI;
import com.intellij.util.ui.UIUtil;
import com.intellij.util.ui.StartupUiUtil;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.Nullable;
@@ -56,10 +57,10 @@ public class ProjectJdkForModuleStep extends ModuleWizardStep {
final JLabel label = new JLabel(IdeBundle.message("prompt.please.select.module.jdk", type.getPresentableName()));
label.setUI(new MultiLineLabelUI());
myPanel.add(label, new GridBagConstraints(0, GridBagConstraints.RELATIVE, 2, 1, 1.0, 0.0, GridBagConstraints.NORTHWEST,
GridBagConstraints.HORIZONTAL, JBUI.insets(8, 10), 0, 0));
GridBagConstraints.HORIZONTAL, JBInsets.create(8, 10), 0, 0));
final JLabel jdkLabel = new JLabel(IdeBundle.message("label.project.jdk"));
jdkLabel.setFont(UIUtil.getLabelFont().deriveFont(Font.BOLD));
jdkLabel.setFont(StartupUiUtil.getLabelFont().deriveFont(Font.BOLD));
myPanel.add(jdkLabel, new GridBagConstraints(0, GridBagConstraints.RELATIVE, 2, 1, 1.0, 0.0, GridBagConstraints.NORTHWEST,
GridBagConstraints.NONE, JBUI.insets(8, 10, 0, 10), 0, 0));

View File

@@ -1,4 +1,4 @@
// 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.
// Copyright 2000-2019 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.ide.util.projectWizard;
import com.intellij.ide.IdeBundle;
@@ -10,7 +10,7 @@ import com.intellij.openapi.project.Project;
import com.intellij.openapi.ui.Messages;
import com.intellij.openapi.util.io.FileUtil;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.util.ui.JBUI;
import com.intellij.util.ui.JBInsets;
import org.jetbrains.annotations.NonNls;
import javax.swing.*;
@@ -39,9 +39,11 @@ public class ProjectNameStep extends ModuleWizardStep {
String appName = ApplicationNamesInfo.getInstance().getFullProductName();
myPanel.add(new JLabel(IdeBundle.message("label.please.enter.project.name", appName, wizardContext.getPresentationName())),
new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 1, 1.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, JBUI.insets(8, 10), 0, 0));
new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 1, 1.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL,
JBInsets.create(8, 10), 0, 0));
myPanel.add(myNamePathComponent, new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 1, 1.0, 1.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, JBUI.insets(8, 10), 0, 0));
myPanel.add(myNamePathComponent, new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 1, 1.0, 1.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL,
JBInsets.create(8, 10), 0, 0));
}
@Override

View File

@@ -1,18 +1,4 @@
/*
* 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-2019 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;
import com.intellij.openapi.Disposable;
@@ -28,6 +14,7 @@ import com.intellij.openapi.util.text.StringUtil;
import com.intellij.ui.*;
import com.intellij.ui.awt.RelativePoint;
import com.intellij.util.Alarm;
import com.intellij.util.ui.StartupUiUtil;
import com.intellij.util.ui.UIUtil;
import com.intellij.util.ui.update.MergingUpdateQueue;
import com.intellij.util.ui.update.Update;
@@ -127,23 +114,23 @@ public class ErrorPaneConfigurable extends JPanel implements Configurable, Dispo
myAlarm.cancelAllRequests();
myAlarm.addRequest(() -> {
final String header = "<html>" +
"<header><style type='text/css'>" +
"body {" +
" color: #" + ColorUtil.toHex(new JBColor(Gray.x33, UIUtil.getLabelForeground())) + ";" +
" font-family: '" + UIUtil.getLabelFont().getName() + ",serif';" +
" font-size: " + UIUtil.getLabelFont().getSize() + ";" +
"}" +
"li {" +
" margin-bottom: 5;" +
"}" +
"ol {" +
"}" +
"a {" +
" text-decoration: none;" +
"}" +
"</style>" +
"</header>" +
"<body>";
"<header><style type='text/css'>" +
"body {" +
" color: #" + ColorUtil.toHex(new JBColor(Gray.x33, UIUtil.getLabelForeground())) + ";" +
" font-family: '" + StartupUiUtil.getLabelFont().getName() + ",serif';" +
" font-size: " + StartupUiUtil.getLabelFont().getSize() + ";" +
"}" +
"li {" +
" margin-bottom: 5;" +
"}" +
"ol {" +
"}" +
"a {" +
" text-decoration: none;" +
"}" +
"</style>" +
"</header>" +
"<body>";
final StringBuilder html = new StringBuilder(header);
int i = 0;
html.append("<ol>");

View File

@@ -41,6 +41,7 @@ import com.intellij.ui.border.CustomLineBorder;
import com.intellij.util.EventDispatcher;
import com.intellij.util.IconUtil;
import com.intellij.util.ui.JBUI;
import com.intellij.util.ui.StartupUiUtil;
import com.intellij.util.ui.ThreeStateCheckBox;
import com.intellij.util.ui.UIUtil;
import org.jetbrains.annotations.NotNull;

View File

@@ -37,11 +37,11 @@ import com.intellij.openapi.ui.popup.util.BaseListPopupStep;
import com.intellij.openapi.wm.IdeFocusManager;
import com.intellij.ui.*;
import com.intellij.ui.awt.RelativePoint;
import com.intellij.ui.scale.JBUIScale;
import com.intellij.ui.table.JBTable;
import com.intellij.util.EventDispatcher;
import com.intellij.util.IconUtil;
import com.intellij.util.containers.ContainerUtil;
import com.intellij.util.ui.JBUI;
import com.intellij.util.ui.TextTransferable;
import gnu.trove.TIntArrayList;
import org.jetbrains.annotations.NotNull;
@@ -306,7 +306,7 @@ public class ClasspathPanelImpl extends JPanel implements ClasspathPanel {
private void setFixedColumnWidth(final int columnIndex, String sampleText) {
final TableColumn column = myEntryTable.getTableHeader().getColumnModel().getColumn(columnIndex);
final FontMetrics fontMetrics = myEntryTable.getFontMetrics(myEntryTable.getFont());
final int width = fontMetrics.stringWidth(" " + sampleText + " ") + JBUI.scale(4);
final int width = fontMetrics.stringWidth(" " + sampleText + " ") + JBUIScale.scale(4);
column.setPreferredWidth(width);
column.setMinWidth(width);
column.setResizable(false);

View File

@@ -1,24 +1,10 @@
/*
* Copyright 2000-2012 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-2019 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.libraryEditor;
import com.intellij.ide.util.treeView.NodeDescriptor;
import com.intellij.ui.ColoredTreeCellRenderer;
import com.intellij.ui.SimpleTextAttributes;
import com.intellij.util.ui.UIUtil;
import com.intellij.util.ui.StartupUiUtil;
import javax.swing.*;
import javax.swing.tree.DefaultMutableTreeNode;
@@ -40,7 +26,7 @@ public class LibraryTreeRenderer extends ColoredTreeCellRenderer {
public Font getFont() {
Font font = super.getFont();
if (font == null) {
font = UIUtil.getLabelFont();
font = StartupUiUtil.getLabelFont();
}
return font;
}

View File

@@ -35,6 +35,7 @@ import com.intellij.util.JavaPsiConstructorUtil;
import com.intellij.util.ObjectUtils;
import com.intellij.util.VisibilityUtil;
import com.intellij.util.containers.MostlySingularMultiMap;
import com.intellij.util.ui.StartupUiUtil;
import com.intellij.util.ui.UIUtil;
import com.intellij.xml.util.XmlStringUtil;
import org.intellij.lang.annotations.Language;
@@ -878,8 +879,8 @@ public class HighlightMethodUtil {
PsiType expectedTypeByParent = PsiTypesUtil.getExpectedTypeByParent(methodCall);
if (expectedTypeByParent != null) {
PsiType methodCallType = methodCall.getType();
if (methodCallType != null &&
TypeConversionUtil.areTypesConvertible(methodCallType, expectedTypeByParent) &&
if (methodCallType != null &&
TypeConversionUtil.areTypesConvertible(methodCallType, expectedTypeByParent) &&
!TypeConversionUtil.isAssignable(expectedTypeByParent, methodCallType)) {
QuickFixAction.registerQuickFixAction(highlightInfo, QUICK_FIX_FACTORY.createAddTypeCastFix(expectedTypeByParent, methodCall));
}
@@ -970,7 +971,7 @@ public class HighlightMethodUtil {
);
}
@NotNull
@NotNull
private static String escTrim(@NotNull String s) {
return XmlStringUtil.escapeString(trimNicely(s));
}
@@ -1713,7 +1714,7 @@ public class HighlightMethodUtil {
else {
applicable = false;
}
}
}
else {
applicable = result != null && result.isApplicable();
}

View File

@@ -32,6 +32,7 @@ import com.intellij.psi.impl.PsiImplUtil;
import com.intellij.psi.impl.source.resolve.JavaResolveUtil;
import com.intellij.psi.impl.source.resolve.graphInference.InferenceSession;
import com.intellij.psi.impl.source.resolve.graphInference.PsiPolyExpressionUtil;
import com.intellij.psi.impl.source.tree.ElementType;
import com.intellij.psi.impl.source.tree.java.PsiLiteralExpressionImpl;
import com.intellij.psi.impl.source.tree.java.PsiReferenceExpressionImpl;
import com.intellij.psi.javadoc.PsiDocComment;
@@ -1009,8 +1010,8 @@ public class HighlightUtil extends HighlightUtilBase {
return null;
}
boolean isInt = PsiLiteralExpressionImpl.INTEGER_LITERALS.contains(type);
boolean isFP = PsiLiteralExpressionImpl.REAL_LITERALS.contains(type);
boolean isInt = ElementType.INTEGER_LITERALS.contains(type);
boolean isFP = ElementType.REAL_LITERALS.contains(type);
String text = isInt || isFP ? StringUtil.toLowerCase(literal.getText()) : literal.getText();
Object value = expression.getValue();
@@ -3095,6 +3096,7 @@ public class HighlightUtil extends HighlightUtilBase {
MODULES(LanguageLevel.JDK_1_9, "feature.modules"),
ENHANCED_SWITCH(LanguageLevel.JDK_12_PREVIEW, "feature.enhanced.switch"),
SWITCH_EXPRESSION(LanguageLevel.JDK_12_PREVIEW, "feature.switch.expressions"),
TEXT_BLOCKS(LanguageLevel.JDK_13_PREVIEW, "feature.text.blocks"),
RAW_LITERALS(LanguageLevel.JDK_X, "feature.raw.literals");
private final LanguageLevel level;

View File

@@ -37,6 +37,7 @@ import com.intellij.psi.infos.CandidateInfo;
import com.intellij.psi.infos.MethodCandidateInfo;
import com.intellij.psi.javadoc.PsiDocComment;
import com.intellij.psi.javadoc.PsiDocTagValue;
import com.intellij.psi.tree.IElementType;
import com.intellij.psi.util.*;
import com.intellij.util.ObjectUtils;
import com.intellij.util.containers.MostlySingularMultiMap;
@@ -54,8 +55,8 @@ public class HighlightVisitorImpl extends JavaElementVisitor implements Highligh
private LanguageLevel myLanguageLevel;
private JavaSdkVersion myJavaSdkVersion;
@SuppressWarnings("StatefulEp") private PsiFile myFile;
@SuppressWarnings("StatefulEp") private PsiJavaModule myJavaModule;
private PsiFile myFile;
private PsiJavaModule myJavaModule;
// map codeBlock->List of PsiReferenceExpression of uninitialized final variables
private final Map<PsiElement, Collection<PsiReferenceExpression>> myUninitializedVarProblems = new THashMap<>();
@@ -467,9 +468,13 @@ public class HighlightVisitorImpl extends JavaElementVisitor implements Highligh
@Override
public void visitJavaToken(PsiJavaToken token) {
super.visitJavaToken(token);
if (!myHolder.hasErrorResults() && token.getTokenType() == JavaTokenType.RAW_STRING_LITERAL) {
myHolder.add(checkFeature(token, Feature.RAW_LITERALS));
if (!myHolder.hasErrorResults()) {
IElementType type = token.getTokenType();
if (type == JavaTokenType.TEXT_BLOCK_LITERAL) myHolder.add(checkFeature(token, Feature.TEXT_BLOCKS));
if (type == JavaTokenType.RAW_STRING_LITERAL) myHolder.add(checkFeature(token, Feature.RAW_LITERALS));
}
if (!myHolder.hasErrorResults() && token.getTokenType() == JavaTokenType.RBRACE && token.getParent() instanceof PsiCodeBlock) {
PsiElement gParent = token.getParent().getParent();
PsiCodeBlock codeBlock;
@@ -809,8 +814,12 @@ public class HighlightVisitorImpl extends JavaElementVisitor implements Highligh
public void visitLiteralExpression(PsiLiteralExpression expression) {
super.visitLiteralExpression(expression);
if (myHolder.hasErrorResults()) return;
myHolder.add(HighlightUtil.checkLiteralExpressionParsingError(expression, myLanguageLevel,myFile));
if (myRefCountHolder != null && !myHolder.hasErrorResults()) registerReferencesFromInjectedFragments(expression);
if (myRefCountHolder != null && !myHolder.hasErrorResults()) {
registerReferencesFromInjectedFragments(expression);
}
if (myRefCountHolder != null && !myHolder.hasErrorResults()) {
for (PsiReference reference : expression.getReferences()) {

View File

@@ -12,6 +12,7 @@ import com.intellij.lang.findUsages.LanguageFindUsages;
import com.intellij.openapi.command.WriteCommandAction;
import com.intellij.openapi.command.undo.UndoUtil;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.psi.*;
import com.intellij.psi.codeStyle.JavaCodeStyleManager;
import com.intellij.psi.impl.light.LightElement;
@@ -68,7 +69,12 @@ public class AddAnnotationPsiFix extends LocalQuickFixOnPsiElement {
@Nullable
public static PsiModifierListOwner getContainer(final PsiFile file, int offset) {
PsiReference reference = file.findReferenceAt(offset);
return getContainer(file, offset, false);
}
@Nullable
public static PsiModifierListOwner getContainer(final PsiFile file, int offset, boolean availableOnReference) {
PsiReference reference = availableOnReference ? file.findReferenceAt(offset) : null;
if (reference != null) {
PsiElement target = reference.resolve();
if (target instanceof PsiMember) {
@@ -140,7 +146,11 @@ public class AddAnnotationPsiFix extends LocalQuickFixOnPsiElement {
if (modifierList == null || modifierList.hasAnnotation(myAnnotation)) return;
PsiClass aClass = JavaPsiFacade.getInstance(project).findClass(myAnnotation, myModifierListOwner.getResolveScope());
final ExternalAnnotationsManager.AnnotationPlace annotationAnnotationPlace;
if (aClass != null && BaseIntentionAction.canModify(myModifierListOwner) && AnnotationsHighlightUtil.getRetentionPolicy(aClass) == RetentionPolicy.RUNTIME) {
if (aClass != null && BaseIntentionAction.canModify(myModifierListOwner) &&
(AnnotationsHighlightUtil.getRetentionPolicy(aClass) == RetentionPolicy.RUNTIME ||
!CommonClassNames.DEFAULT_PACKAGE.equals(StringUtil.getPackageName(myAnnotation)) &&
JavaPsiFacade.getInstance(project).getResolveHelper()//if class is already imported in current file
.resolveReferencedClass(StringUtil.getShortName(myAnnotation), myModifierListOwner) != null)) {
annotationAnnotationPlace = ExternalAnnotationsManager.AnnotationPlace.IN_CODE;
}
else {

View File

@@ -689,7 +689,7 @@ public class CFGBuilder {
}
// Unknown function
flushFields();
myAnalyzer.addConditionalRuntimeThrow();
myAnalyzer.addConditionalErrorThrow();
PsiType functionalInterfaceType = functionalExpression.getType();
myAnalyzer.addMethodThrows(LambdaUtil.getFunctionalInterfaceMethod(functionalInterfaceType), null);
PsiType returnType = LambdaUtil.getFunctionalInterfaceReturnType(functionalInterfaceType);

View File

@@ -129,6 +129,7 @@ public class ControlFlowAnalyzer extends JavaElementVisitor {
return myCodeFragment;
}
@NotNull
private PsiClassType createClassType(GlobalSearchScope scope, String fqn) {
PsiClass aClass = JavaPsiFacade.getInstance(myProject).findClass(fqn, scope);
if (aClass != null) return JavaPsiFacade.getElementFactory(myProject).createType(aClass);
@@ -1028,7 +1029,7 @@ public class ControlFlowAnalyzer extends JavaElementVisitor {
finishElement(statement);
}
void addConditionalRuntimeThrow() {
void addConditionalErrorThrow() {
if (!shouldHandleException()) {
return;
}
@@ -1036,10 +1037,6 @@ public class ControlFlowAnalyzer extends JavaElementVisitor {
pushUnknown();
final ConditionalGotoInstruction ifNoException = addInstruction(new ConditionalGotoInstruction(null, false, null));
pushUnknown();
final ConditionalGotoInstruction ifError = addInstruction(new ConditionalGotoInstruction(null, false, null));
throwException(myExceptionCache.get(JAVA_LANG_RUNTIME_EXCEPTION), null);
ifError.setOffset(myCurrentFlow.getInstructionCount());
throwException(myExceptionCache.get(JAVA_LANG_ERROR), null);
ifNoException.setOffset(myCurrentFlow.getInstructionCount());
@@ -1145,7 +1142,7 @@ public class ControlFlowAnalyzer extends JavaElementVisitor {
pushTrap(new InsideFinally(resourceList));
startElement(resourceList);
addInstruction(new FlushFieldsInstruction());
addThrows(null, closerExceptions.toArray(PsiClassType.EMPTY_ARRAY));
addThrows(null, closerExceptions);
controlTransfer(new ExitFinallyTransfer(twrFinallyDescriptor), FList.emptyList()); // DfaControlTransferValue is on stack
finishElement(resourceList);
popTrap(InsideFinally.class);
@@ -1489,7 +1486,7 @@ public class ControlFlowAnalyzer extends JavaElementVisitor {
addInstruction(new UnwrapSpecialFieldInstruction(SpecialField.UNBOX));
}
else if (TypeConversionUtil.isPrimitiveAndNotNull(actualType) && TypeConversionUtil.isAssignableFromPrimitiveWrapper(expectedType)) {
addConditionalRuntimeThrow();
addConditionalErrorThrow();
PsiType boxedType = ((PsiPrimitiveType)actualType).getBoxedType(context);
addInstruction(new BoxingInstruction(boxedType));
}
@@ -1648,13 +1645,17 @@ public class ControlFlowAnalyzer extends JavaElementVisitor {
}
void addMethodThrows(PsiMethod method, @Nullable PsiElement explicitCall) {
if (method != null && shouldHandleException()) {
addThrows(explicitCall, method.getThrowsList().getReferencedTypes());
if (shouldHandleException()) {
addThrows(explicitCall, method == null ? Collections.emptyList() : Arrays.asList(method.getThrowsList().getReferencedTypes()));
}
}
private void addThrows(@Nullable PsiElement explicitCall, PsiClassType[] refs) {
for (PsiClassType ref : refs) {
private void addThrows(@Nullable PsiElement explicitCall, Collection<? extends PsiType> exceptions) {
List<PsiType> allExceptions = new ArrayList<>(exceptions);
allExceptions.add(myExceptionCache.get(JAVA_LANG_ERROR).getThrowable().getPsiType());
allExceptions.add(myExceptionCache.get(JAVA_LANG_RUNTIME_EXCEPTION).getThrowable().getPsiType());
List<PsiType> refs = PsiDisjunctionType.flattenAndRemoveDuplicates(allExceptions);
for (PsiType ref : refs) {
pushUnknown();
ConditionalGotoInstruction cond = new ConditionalGotoInstruction(null, false, null);
addInstruction(cond);
@@ -1743,7 +1744,7 @@ public class ControlFlowAnalyzer extends JavaElementVisitor {
}
void addBareCall(@Nullable PsiMethodCallExpression expression, @NotNull PsiReferenceExpression reference) {
addConditionalRuntimeThrow();
addConditionalErrorThrow();
PsiMethod method = ObjectUtils.tryCast(reference.resolve(), PsiMethod.class);
List<? extends MethodContract> contracts =
method == null ? Collections.emptyList() :
@@ -1766,7 +1767,7 @@ public class ControlFlowAnalyzer extends JavaElementVisitor {
addInstruction(new BinopInstruction(JavaTokenType.EQEQ, null, PsiType.BOOLEAN));
ConditionalGotoInstruction ifNotFail = new ConditionalGotoInstruction(null, true, null);
addInstruction(ifNotFail);
addInstruction(new ReturnInstruction(myFactory.controlTransfer(new ExceptionTransfer(null), myTrapStack), anchor));
addInstruction(new ReturnInstruction(myFactory.controlTransfer(myExceptionCache.get(JAVA_LANG_THROWABLE), myTrapStack), anchor));
ifNotFail.setOffset(myCurrentFlow.getInstructionCount());
}
@@ -1852,7 +1853,7 @@ public class ControlFlowAnalyzer extends JavaElementVisitor {
handleEscapedVariables(anonymousClass);
}
addConditionalRuntimeThrow();
addConditionalErrorThrow();
DfaValue precalculatedNewValue = getPrecalculatedNewValue(expression);
List<? extends MethodContract> contracts = constructor == null ? Collections.emptyList() : JavaMethodContractUtil.getMethodContracts(constructor);
addInstruction(new MethodCallInstruction(expression, precalculatedNewValue, DfaUtil.addRangeContracts(constructor, contracts)));

View File

@@ -46,7 +46,7 @@ import java.util.*;
import static com.intellij.util.ObjectUtils.tryCast;
public class DataFlowInspectionBase extends AbstractBaseJavaLocalInspectionTool {
public abstract class DataFlowInspectionBase extends AbstractBaseJavaLocalInspectionTool {
static final Logger LOG = Logger.getInstance("#com.intellij.codeInspection.dataFlow.DataFlowInspection");
@NonNls private static final String SHORT_NAME = "ConstantConditions";
public boolean SUGGEST_NULLABLE_ANNOTATIONS;
@@ -229,6 +229,11 @@ public class DataFlowInspectionBase extends AbstractBaseJavaLocalInspectionTool
}
}
@NotNull
protected List<LocalQuickFix> createCastFixes(PsiTypeCastExpression castExpression, boolean onTheFly) {
return Collections.emptyList();
}
@NotNull
protected List<LocalQuickFix> createNPEFixes(PsiExpression qualifier, PsiExpression expression, boolean onTheFly) {
return Collections.emptyList();
@@ -697,11 +702,11 @@ public class DataFlowInspectionBase extends AbstractBaseJavaLocalInspectionTool
PsiTypeElement castType = typeCast.getCastType();
assert castType != null;
assert operand != null;
LocalQuickFix fix = null;
List<LocalQuickFix> fixes = new ArrayList<>(createCastFixes(typeCast, reporter.isOnTheFly()));
if (reporter.isOnTheFly()) {
fix = createExplainFix(typeCast, new TrackingRunner.CastDfaProblemType());
fixes.add(createExplainFix(typeCast, new TrackingRunner.CastDfaProblemType()));
}
reporter.registerProblem(castType, InspectionsBundle.message("dataflow.message.cce", operand.getText()), fix);
reporter.registerProblem(castType, InspectionsBundle.message("dataflow.message.cce", operand.getText()), fixes.toArray(LocalQuickFix.EMPTY_ARRAY));
}
}
@@ -899,7 +904,7 @@ public class DataFlowInspectionBase extends AbstractBaseJavaLocalInspectionTool
final String text = isNullLiteralExpression(expr) || expressions.get(expr) == ConstantResult.NULL
? InspectionsBundle.message("dataflow.message.return.null.from.notnull", presentable)
: InspectionsBundle.message("dataflow.message.return.nullable.from.notnull", presentable);
reporter.registerProblem(expr, text);
reporter.registerProblem(expr, text, createNPEFixes(expr, expr, reporter.isOnTheFly()).toArray(LocalQuickFix.EMPTY_ARRAY));
}
else if (AnnotationUtil.isAnnotatingApplicable(anchor)) {
final String defaultNullable = manager.getDefaultNullable();

View File

@@ -1419,8 +1419,16 @@ public class DfaMemoryStateImpl implements DfaMemoryState {
private DfaVariableValue canonicalize(DfaVariableValue var) {
DfaVariableValue qualifier = var.getQualifier();
if (qualifier != null) {
EqClass eqClass = getEqClass(qualifier);
return var.withQualifier(eqClass == null ? canonicalize(qualifier) : Objects.requireNonNull(eqClass.getCanonicalVariable()));
Integer index = myIdToEqClassesIndices.get(qualifier.getID());
if (index == null) {
qualifier = canonicalize(qualifier);
index = myIdToEqClassesIndices.get(qualifier.getID());
if (index == null) {
return var.withQualifier(qualifier);
}
}
return var.withQualifier(Objects.requireNonNull(myEqClasses.get(index).getCanonicalVariable()));
}
return var;
}

View File

@@ -43,7 +43,7 @@ interface TransferTarget {
/** @return next instruction states assuming no traps */
fun dispatch(state: DfaMemoryState, runner: DataFlowRunner) : List<DfaInstructionState> = emptyList()
}
data class ExceptionTransfer(val throwable: DfaPsiType?) : TransferTarget {
data class ExceptionTransfer(val throwable: DfaPsiType) : TransferTarget {
override fun toString(): String = "Exception($throwable)"
}
data class InstructionTransfer(val offset: ControlFlow.ControlFlowOffset, private val toFlush: List<DfaVariableValue>) : TransferTarget {

View File

@@ -1,4 +1,4 @@
// 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.
// Copyright 2000-2019 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.ide.highlighter;
import com.intellij.lexer.JavaHighlightingLexer;
@@ -45,6 +45,7 @@ public class JavaFileHighlighter extends SyntaxHighlighterBase {
ourMap1.put(JavaTokenType.FLOAT_LITERAL, JavaHighlightingColors.NUMBER);
ourMap1.put(JavaTokenType.DOUBLE_LITERAL, JavaHighlightingColors.NUMBER);
ourMap1.put(JavaTokenType.STRING_LITERAL, JavaHighlightingColors.STRING);
ourMap1.put(JavaTokenType.TEXT_BLOCK_LITERAL, JavaHighlightingColors.STRING);
ourMap1.put(JavaTokenType.RAW_STRING_LITERAL, JavaHighlightingColors.STRING);
ourMap1.put(StringEscapesTokenTypes.VALID_STRING_ESCAPE_TOKEN, JavaHighlightingColors.VALID_STRING_ESCAPE);
ourMap1.put(StringEscapesTokenTypes.INVALID_CHARACTER_ESCAPE_TOKEN, JavaHighlightingColors.INVALID_STRING_ESCAPE);

View File

@@ -52,11 +52,6 @@ public class JavaLanguageLevelPusher implements FilePropertyPusher<LanguageLevel
}
}
@Override
public void initExtra(@NotNull Project project, @NotNull MessageBus bus, @NotNull Engine languageLevelUpdater) {
// nothing
}
@Override
@NotNull
public Key<LanguageLevel> getFileDataKey() {

View File

@@ -57,6 +57,9 @@
<interface-class>com.intellij.psi.RefResolveService</interface-class>
<implementation-class>com.intellij.psi.refResolve.RefResolveServiceImpl</implementation-class>
</component>
<component>
<implementation-class>com.intellij.codeInsight.hints.AnnotationHintsPassFactory</implementation-class>
</component>
<component>
<implementation-class>com.intellij.lang.java.JavaModuleRenameListener</implementation-class>
</component>
@@ -300,7 +303,6 @@
<extensions defaultExtensionNs="com.intellij">
<highlightingPassFactory implementation="com.intellij.codeInsight.hints.AnnotationHintsPassFactory"/>
<highlightingPassFactory implementation="com.intellij.codeInsight.hints.MethodChainHintsPassFactory"/>
<highlightingPassFactory implementation="com.intellij.framework.detection.impl.FrameworkDetectionManager$FrameworkDetectionHighlightingPassFactory"/>
<virtualFileSystem implementationClass="com.intellij.openapi.vfs.impl.jrt.JrtFileSystemImpl" key="jrt" physical="true"/>
@@ -879,7 +881,6 @@
<inlineActionHandler implementation="com.intellij.refactoring.inline.InlineParameterHandler"/>
<highlightVisitor implementation="com.intellij.codeInsight.daemon.JavaRainbowVisitor"/>
<problemHighlightFilter implementation="com.intellij.codeInsight.daemon.JavaProblemHighlightFilter"/>
<bundledKeymapProvider implementation="com.intellij.openapi.keymap.JBuilderKeymapProvider"/>
<todoIndexer filetype="JAVA" implementationClass="com.intellij.psi.impl.cache.impl.idCache.JavaTodoIndexer"/>
<idIndexer filetype="JAVA" implementationClass="com.intellij.psi.impl.cache.impl.idCache.JavaIdIndexer"/>
<fileIconPatcher id="javaFileIconPatcher" implementation="com.intellij.ide.JavaFileIconPatcher"/>
@@ -1099,7 +1100,6 @@
<editorSmartKeysConfigurable instance="com.intellij.application.options.JavadocOptionsProvider" id="editor.preferences.javadocOptions"
key="javadoc.generate.message.title" bundle="messages.JavadocBundle"/>
<editorAppearanceConfigurable instance="com.intellij.codeInsight.hints.AnnotationHintsConfigurable"/>
<editorAppearanceConfigurable instance="com.intellij.codeInsight.hints.MethodChainHintsConfigurable"/>
<wordBoundaryFilter language="JAVA" implementationClass="com.intellij.codeInsight.editorActions.JavaWordBoundaryFilter"/>
<editorActionHandler action="PrevParameter" implementationClass="com.intellij.codeInsight.editorActions.JavaPrevParameterHandler"/>
<editorActionHandler action="NextParameter" implementationClass="com.intellij.codeInsight.editorActions.JavaNextParameterHandler"/>
@@ -1144,6 +1144,7 @@
<codeInsight.parameterInfo language="JAVA" implementationClass="com.intellij.codeInsight.hint.api.impls.ReferenceParameterInfoHandler"/>
<codeInsight.parameterInfo language="JAVA" implementationClass="com.intellij.codeInsight.hint.api.impls.MethodParameterInfoHandler"/>
<codeInsight.parameterNameHints language="JAVA" implementationClass="com.intellij.codeInsight.hints.JavaInlayParameterHintsProvider"/>
<codeInsight.inlayProvider language="JAVA" implementationClass="com.intellij.codeInsight.hints.MethodChainsInlayProvider"/>
<lang.foldingBuilder language="JAVA" implementationClass="com.intellij.codeInsight.folding.impl.JavaFoldingBuilder"/>
<lang.braceMatcher language="JAVA" implementationClass="com.intellij.codeInsight.highlighting.JavaPairedBraceMatcher"/>
<anonymousElementProvider implementation="com.intellij.lang.java.JavaAnonymousClassesProvider" />

Some files were not shown because too many files have changed in this diff Show More