fix yellow code - rationalize static call

GitOrigin-RevId: 2dc783a75d852bd9c8a537ef6ed6bfac07640177
This commit is contained in:
Vladimir Krivosheev
2019-06-03 21:12:14 +02:00
committed by intellij-monorepo-bot
parent 2ad37d8194
commit a8c510ae57
76 changed files with 259 additions and 706 deletions

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;
@@ -455,7 +456,7 @@ public class BackgroundImageDialog extends DialogWrapper {
@NotNull
private static Color getSelectionBackground() {
return ColorUtil.mix(UIUtil.getListSelectionBackground(), UIUtil.getLabelBackground(), UIUtil.isUnderDarcula() ? .5 : .75);
return ColorUtil.mix(UIUtil.getListSelectionBackground(), UIUtil.getLabelBackground(), StartupUiUtil.isUnderDarcula() ? .5 : .75);
}
private static void initFlipPanel(@NotNull JPanel p, @NotNull JBCheckBox flipHorCb, @NotNull JBCheckBox flipVerCb) {

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,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

@@ -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

@@ -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

@@ -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

@@ -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

@@ -1,24 +1,10 @@
/*
* 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;
import com.intellij.icons.AllIcons;
import com.intellij.ui.components.JBLabel;
import com.intellij.util.ui.UIUtil;
import com.intellij.util.ui.StartupUiUtil;
import com.intellij.util.ui.components.BorderLayoutPanel;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -33,7 +19,7 @@ class FilteringProgressView extends BorderLayoutPanel {
private final JProgressBar myProgressBar = new JProgressBar();
private final BorderLayoutPanel myProgressPanel = new BorderLayoutPanel();
private final JBLabel myStopButton = new JBLabel(UIUtil.isUnderDarcula()
private final JBLabel myStopButton = new JBLabel(StartupUiUtil.isUnderDarcula()
? AllIcons.Actions.Clean : AllIcons.Actions.CleanLight);
private final JBLabel myProgressText = new JBLabel();

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

@@ -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-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;
@@ -17,7 +17,7 @@ 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.JBUI;
import com.intellij.util.ui.UIUtil;
import com.intellij.util.ui.StartupUiUtil;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.Nullable;
@@ -59,7 +59,7 @@ public class ProjectJdkForModuleStep extends ModuleWizardStep {
GridBagConstraints.HORIZONTAL, JBUI.insets(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,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;
@@ -199,13 +200,13 @@ public class ArtifactEditorImpl implements ArtifactEditorEx {
final JBSplitter splitter = new OnePixelSplitter(false);
final JPanel leftPanel = new JPanel(new BorderLayout());
JPanel treePanel = myLayoutTreeComponent.getTreePanel();
if (UIUtil.isUnderDarcula()) {
if (StartupUiUtil.isUnderDarcula()) {
treePanel.setBorder(JBUI.Borders.emptyTop(3));
} else {
treePanel.setBorder(new LineBorder(JBColor.border()));
}
leftPanel.add(treePanel, BorderLayout.CENTER);
if (UIUtil.isUnderDarcula()) {
if (StartupUiUtil.isUnderDarcula()) {
CompoundBorder border =
new CompoundBorder(new CustomLineBorder(0, 0, 0, 1), JBUI.Borders.empty());
leftPanel.setBorder(border);
@@ -238,14 +239,14 @@ public class ArtifactEditorImpl implements ArtifactEditorEx {
JScrollPane scrollPane = ScrollPaneFactory.createScrollPane(mySourceItemsTree, true);
JPanel scrollPaneWrap = new JPanel(new BorderLayout());
scrollPaneWrap.add(scrollPane, BorderLayout.CENTER);
if (UIUtil.isUnderDarcula()) {
if (StartupUiUtil.isUnderDarcula()) {
scrollPaneWrap.setBorder(JBUI.Borders.emptyTop(3));
} else {
scrollPaneWrap.setBorder(new LineBorder(JBColor.border()));
}
rightPanel.add(scrollPaneWrap, BorderLayout.CENTER);
if (UIUtil.isUnderDarcula()) {
if (StartupUiUtil.isUnderDarcula()) {
rightPanel.setBorder(new CompoundBorder(new CustomLineBorder(0, 1, 0, 0), JBUI.Borders.empty()));
} else {
rightPanel.setBorder(JBUI.Borders.empty(3, 0, 3, 3));
@@ -276,7 +277,7 @@ public class ArtifactEditorImpl implements ArtifactEditorEx {
ActionToolbar toolbar = ActionManager.getInstance().createActionToolbar("ProjectStructureArtifactEditor", createToolbarActionGroup(), true);
JComponent toolbarComponent = toolbar.getComponent();
if (UIUtil.isUnderDarcula()) {
if (StartupUiUtil.isUnderDarcula()) {
toolbarComponent.setBorder(new CustomLineBorder(0, 0, 1, 0));
}
leftPanel.add(toolbarComponent, BorderLayout.NORTH);

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;
@@ -47,7 +48,7 @@ import java.util.stream.Stream;
public class HighlightMethodUtil {
private static final QuickFixFactory QUICK_FIX_FACTORY = QuickFixFactory.getInstance();
private static final String MISMATCH_COLOR = UIUtil.isUnderDarcula() ? "ff6464" : "red";
private static final String MISMATCH_COLOR = StartupUiUtil.isUnderDarcula() ? "ff6464" : "red";
private static final Logger LOG = Logger.getInstance(HighlightMethodUtil.class);
private HighlightMethodUtil() { }
@@ -632,7 +633,7 @@ public class HighlightMethodUtil {
return XmlStringUtil.wrapInHtml("<body>" + XmlStringUtil.escapeString(message) +
" <a href=\"#assignment/" + XmlStringUtil.escapeString(createMismatchedArgumentsHtmlTooltip(candidateInfo, list)) + "\"" +
(UIUtil.isUnderDarcula() ? " color=\"7AB4C9\" " : "") +
(StartupUiUtil.isUnderDarcula() ? " color=\"7AB4C9\" " : "") +
">" + DaemonBundle.message("inspection.extended.description") + "</a></body>");
}
}
@@ -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));
}
@@ -1032,12 +1033,12 @@ public class HighlightMethodUtil {
PsiParameter parameter = i < parameters.length ? parameters[i] : null;
PsiExpression expression = i < expressions.length ? expressions[i] : null;
boolean showShort = showShortType(i, parameters, expressions, substitutor);
String mismatchColor = showShort ? null : UIUtil.isUnderDarcula() ? "FF6B68" : "red";
String mismatchColor = showShort ? null : StartupUiUtil.isUnderDarcula() ? "FF6B68" : "red";
s.append("<tr");
if (i % 2 == 0) {
//noinspection SpellCheckingInspection
String bg = UIUtil.isUnderDarcula() ? ColorUtil.toHex(ColorUtil.shift(UIUtil.getToolTipBackground(), 1.1)) : "eeeeee";
String bg = StartupUiUtil.isUnderDarcula() ? ColorUtil.toHex(ColorUtil.shift(UIUtil.getToolTipBackground(), 1.1)) : "eeeeee";
s.append(" style='background-color: #").append(bg).append("'");
}
s.append(">");
@@ -1713,7 +1714,7 @@ public class HighlightMethodUtil {
else {
applicable = false;
}
}
}
else {
applicable = result != null && result.isApplicable();
}

View File

@@ -49,7 +49,7 @@ import com.intellij.util.ObjectUtils;
import com.intellij.util.containers.ContainerUtil;
import com.intellij.util.containers.MultiMap;
import com.intellij.util.containers.hash.HashSet;
import com.intellij.util.ui.UIUtil;
import com.intellij.util.ui.StartupUiUtil;
import com.intellij.xml.util.XmlStringUtil;
import com.siyeh.ig.psiutils.ControlFlowUtils;
import gnu.trove.THashMap;
@@ -2751,7 +2751,7 @@ public class HighlightUtil extends HighlightUtilBase {
@NotNull
private static String redIfNotMatch(@Nullable PsiType type, boolean matches) {
if (matches) return getFQName(type, false);
String color = UIUtil.isUnderDarcula() ? "FF6B68" : "red";
String color = StartupUiUtil.isUnderDarcula() ? "FF6B68" : "red";
return "<font color='" + color +"'><b>" + getFQName(type, true) + "</b></font>";
}

View File

@@ -1,18 +1,4 @@
/*
* 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.codeInsight.completion;
import com.intellij.codeInsight.lookup.LookupElement;
@@ -20,10 +6,9 @@ import com.intellij.codeInsight.lookup.LookupElementDecorator;
import com.intellij.codeInsight.lookup.LookupElementPresentation;
import com.intellij.codeInsight.lookup.LookupElementRenderer;
import com.intellij.openapi.module.Module;
import com.intellij.openapi.module.ModuleUtil;
import com.intellij.openapi.module.ModuleUtilCore;
import com.intellij.psi.PsiClass;
import com.intellij.refactoring.ui.ClassNameReferenceEditor;
import com.intellij.util.Consumer;
import org.jetbrains.annotations.NotNull;
/**
@@ -35,12 +20,12 @@ public class RefactoringCompletionContributor extends CompletionContributor {
if (parameters.getOriginalFile().getUserData(ClassNameReferenceEditor.CLASS_NAME_REFERENCE_FRAGMENT) == null) {
return;
}
resultSet.runRemainingContributors(parameters, result -> {
LookupElement element = result.getLookupElement();
Object object = element.getObject();
if (object instanceof PsiClass) {
Module module = ModuleUtil.findModuleForPsiElement((PsiClass)object);
Module module = ModuleUtilCore.findModuleForPsiElement((PsiClass)object);
if (module != null) {
resultSet.consume(LookupElementDecorator.withRenderer(element, new AppendModuleName(module)));
return;

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.codeInsight.generation;
import com.intellij.codeInsight.hint.HintManager;
@@ -47,7 +33,7 @@ public class JavaImplementMethodsHandler implements ContextAwareActionHandler, L
if (aClass == null) {
return;
}
if (OverrideImplementUtil.getMethodSignaturesToImplement(aClass).isEmpty()) {
if (OverrideImplementExploreUtil.getMethodSignaturesToImplement(aClass).isEmpty()) {
HintManager.getInstance().showErrorHint(editor, "No methods to implement have been found");
return;
}
@@ -62,6 +48,6 @@ public class JavaImplementMethodsHandler implements ContextAwareActionHandler, L
@Override
public boolean isAvailableForQuickList(@NotNull Editor editor, @NotNull PsiFile file, @NotNull DataContext dataContext) {
PsiClass aClass = OverrideImplementUtil.getContextClass(file.getProject(), editor, file, PsiUtil.isLanguageLevel8OrHigher(file));
return aClass != null && !OverrideImplementUtil.getMethodSignaturesToImplement(aClass).isEmpty();
return aClass != null && !OverrideImplementExploreUtil.getMethodSignaturesToImplement(aClass).isEmpty();
}
}

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.codeInsight.generation;
import com.intellij.codeInsight.hint.HintManager;
@@ -45,7 +31,7 @@ public class JavaOverrideMethodsHandler implements ContextAwareActionHandler, La
PsiClass aClass = OverrideImplementUtil.getContextClass(project, editor, file, true);
if (aClass == null) return;
if (OverrideImplementUtil.getMethodSignaturesToOverride(aClass).isEmpty()) {
if (OverrideImplementExploreUtil.getMethodSignaturesToOverride(aClass).isEmpty()) {
HintManager.getInstance().showErrorHint(editor, "No methods to override have been found");
return;
}
@@ -60,6 +46,6 @@ public class JavaOverrideMethodsHandler implements ContextAwareActionHandler, La
@Override
public boolean isAvailableForQuickList(@NotNull Editor editor, @NotNull PsiFile file, @NotNull DataContext dataContext) {
PsiClass aClass = OverrideImplementUtil.getContextClass(file.getProject(), editor, file, true);
return aClass != null && !OverrideImplementUtil.getMethodSignaturesToOverride(aClass).isEmpty();
return aClass != null && !OverrideImplementExploreUtil.getMethodSignaturesToOverride(aClass).isEmpty();
}
}

View File

@@ -38,6 +38,7 @@ import com.intellij.util.containers.ContainerUtil;
import com.intellij.util.text.CharArrayUtil;
import com.intellij.util.text.DateFormatUtil;
import com.intellij.util.ui.JBUI;
import com.intellij.util.ui.StartupUiUtil;
import com.intellij.util.ui.UIUtil;
import org.jdom.Element;
import org.jetbrains.annotations.NonNls;
@@ -654,7 +655,7 @@ public class UnusedDeclarationPresentation extends DefaultInspectionToolPresenta
css.addRule("p.problem-description-group {text-indent: " + JBUI.scale(9) + "px;font-weight:bold;}");
css.addRule("div.problem-description {margin-left: " + JBUI.scale(9) + "px;}");
css.addRule("ul {margin-left:" + JBUI.scale(10) + "px;text-indent: 0}");
css.addRule("code {font-family:" + UIUtil.getLabelFont().getFamily() + "}");
css.addRule("code {font-family:" + StartupUiUtil.getLabelFont().getFamily() + "}");
final StringBuffer buf = new StringBuffer();
getComposer().compose(buf, entity, false);
final String text = buf.toString();

View File

@@ -1,6 +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.
package com.intellij.ide.hierarchy.method;
import com.intellij.codeInsight.generation.OverrideImplementExploreUtil;
import com.intellij.codeInsight.generation.OverrideImplementUtil;
import com.intellij.ide.hierarchy.HierarchyNodeDescriptor;
import com.intellij.ide.hierarchy.MethodHierarchyBrowserBase;
@@ -132,8 +133,8 @@ abstract class OverrideImplementMethodAction extends AnAction {
final MethodSignature signature = baseMethod.getSignature(PsiSubstitutor.EMPTY);
Collection<MethodSignature> allOriginalSignatures = toImplement
? OverrideImplementUtil.getMethodSignaturesToImplement(psiClass)
: OverrideImplementUtil.getMethodSignaturesToOverride(psiClass);
? OverrideImplementExploreUtil.getMethodSignaturesToImplement(psiClass)
: OverrideImplementExploreUtil.getMethodSignaturesToOverride(psiClass);
for (final MethodSignature originalSignature : allOriginalSignatures) {
if (originalSignature.equals(signature)) {
return true;

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;
import com.intellij.ide.IdeBundle;
@@ -8,7 +8,7 @@ import com.intellij.openapi.application.WriteAction;
import com.intellij.openapi.command.CommandProcessor;
import com.intellij.openapi.diagnostic.Logger;
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.project.ProjectBundle;
import com.intellij.openapi.projectRoots.impl.ProjectRootUtil;
@@ -295,7 +295,7 @@ public class PackageUtil {
private static PsiDirectory getWritableModuleDirectory(@NotNull Query<? extends VirtualFile> vFiles, @NotNull Module module, PsiManager manager) {
for (VirtualFile vFile : vFiles) {
if (ModuleUtil.findModuleForFile(vFile, module.getProject()) != module) continue;
if (ModuleUtilCore.findModuleForFile(vFile, module.getProject()) != module) continue;
PsiDirectory directory = manager.findDirectory(vFile);
if (directory != null && directory.isValid() && directory.isWritable()) {
return directory;

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.refactoring.extractMethod.preview;
import com.intellij.openapi.editor.colors.EditorColorsScheme;
@@ -8,7 +8,7 @@ import com.intellij.ui.SimpleTextAttributes;
import com.intellij.usageView.UsageTreeColors;
import com.intellij.usageView.UsageTreeColorsScheme;
import com.intellij.usages.TextChunk;
import com.intellij.util.ui.UIUtil;
import com.intellij.util.ui.StartupUiUtil;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -48,7 +48,7 @@ class PreviewTreeRenderer extends ColoredTreeCellRenderer {
append(node.getLineNumberChunk(), node);
}
else {
SimpleTextAttributes attributes = UIUtil.isUnderDarcula() ? ourInvalidAttributesDarcula : ourInvalidAttributes;
SimpleTextAttributes attributes = StartupUiUtil.isUnderDarcula() ? ourInvalidAttributesDarcula : ourInvalidAttributes;
append("Invalid ", patchMainTextAttrs(attributes, node));
}

View File

@@ -1,24 +1,10 @@
/*
* 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 com.intellij.refactoring.extractSuperclass;
import com.intellij.codeInsight.generation.OverrideImplementExploreUtil;
import com.intellij.openapi.diagnostic.Logger;
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.ProjectRootManager;
import com.intellij.openapi.ui.DialogWrapper;
@@ -39,15 +25,11 @@ import com.intellij.refactoring.util.DocCommentPolicy;
import com.intellij.refactoring.util.RefactoringUtil;
import com.intellij.refactoring.util.classMembers.MemberInfo;
import com.intellij.util.IncorrectOperationException;
import java.util.HashMap;
import com.intellij.util.containers.MultiMap;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.Nullable;
import java.util.Collection;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import java.util.*;
/**
* @author dsl
@@ -238,7 +220,7 @@ public class ExtractSuperClassUtil {
final VirtualFile virtualFile = subclass.getContainingFile().getVirtualFile();
if (virtualFile != null) {
final boolean inTestSourceContent = ProjectRootManager.getInstance(subclass.getProject()).getFileIndex().isInTestSourceContent(virtualFile);
final Module module = ModuleUtil.findModuleForFile(virtualFile, subclass.getProject());
final Module module = ModuleUtilCore.findModuleForFile(virtualFile, subclass.getProject());
if (targetDirectory != null &&
module != null &&
!GlobalSearchScope.moduleWithDependenciesAndLibrariesScope(module, inTestSourceContent).contains(targetDirectory.getVirtualFile())) {

View File

@@ -1,4 +1,4 @@
// 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.refactoring.inline;
import com.intellij.codeInsight.AnnotationUtil;
@@ -39,7 +39,7 @@ import com.intellij.refactoring.RefactoringBundle;
import com.intellij.refactoring.introduceParameter.Util;
import com.intellij.refactoring.listeners.RefactoringEventData;
import com.intellij.refactoring.rename.NonCodeUsageInfoFactory;
import com.intellij.refactoring.rename.RenameJavaVariableProcessor;
import com.intellij.refactoring.rename.RenameJavaMemberProcessor;
import com.intellij.refactoring.util.*;
import com.intellij.usageView.UsageInfo;
import com.intellij.usageView.UsageViewDescriptor;
@@ -206,8 +206,8 @@ public class InlineMethodProcessor extends BaseRefactoringProcessor {
final PsiMethod[] superMethods = myMethod.findSuperMethods();
for (PsiMethod method : superMethods) {
String className = Objects.requireNonNull(method.getContainingClass()).getQualifiedName();
final String message = method.hasModifierProperty(PsiModifier.ABSTRACT) ?
RefactoringBundle.message("inlined.method.implements.method.from.0", className) :
final String message = method.hasModifierProperty(PsiModifier.ABSTRACT) ?
RefactoringBundle.message("inlined.method.implements.method.from.0", className) :
RefactoringBundle.message("inlined.method.overrides.method.from.0", className);
conflicts.putValue(method, message);
}
@@ -751,7 +751,7 @@ public class InlineMethodProcessor extends BaseRefactoringProcessor {
if (myMethod.isPhysical()) {
// Could be specialized
LOG.assertTrue(myManager.areElementsEquivalent(resolveResult.getElement(), myMethod));
}
}
if (resolveResult.getSubstitutor() != PsiSubstitutor.EMPTY) {
Iterator<PsiTypeParameter> oldTypeParameters = PsiUtil.typeParametersIterator(myMethod);
Iterator<PsiTypeParameter> newTypeParameters = PsiUtil.typeParametersIterator(myMethodCopy);
@@ -1240,7 +1240,7 @@ public class InlineMethodProcessor extends BaseRefactoringProcessor {
if (modifiers != null && modifiers.getAnnotations().length != 0) return;
boolean effectivelyFinal = HighlightControlFlowUtil.isEffectivelyFinal(variable, context, null);
if (!effectivelyFinal && !VariableAccessUtils.canUseAsNonFinal(target)) return;
for (PsiReferenceExpression reference : references) {
ExpressionUtils.bindReferenceTo(reference, name);
}
@@ -1368,7 +1368,7 @@ public class InlineMethodProcessor extends BaseRefactoringProcessor {
PsiExpressionStatement statement = (PsiExpressionStatement)myFactory.createStatementFromText(field.getName() + " = 0;", body);
statement = (PsiExpressionStatement)body.add(statement);
final PsiAssignmentExpression assignment = (PsiAssignmentExpression)statement.getExpression();
assignment.getLExpression().replace(RenameJavaVariableProcessor.createMemberReference(field, assignment));
assignment.getLExpression().replace(RenameJavaMemberProcessor.createMemberReference(field, assignment));
assignment.getRExpression().replace(initializer);
addMarkedElements(refsVector, statement);
if (field.hasModifierProperty(PsiModifier.STATIC)) {

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.refactoring.introduceField;
@@ -53,7 +39,7 @@ import com.intellij.refactoring.IntroduceHandlerBase;
import com.intellij.refactoring.RefactoringBundle;
import com.intellij.refactoring.introduce.inplace.AbstractInplaceIntroducer;
import com.intellij.refactoring.introduceVariable.IntroduceVariableBase;
import com.intellij.refactoring.rename.RenameJavaVariableProcessor;
import com.intellij.refactoring.rename.RenameJavaMemberProcessor;
import com.intellij.refactoring.util.CommonRefactoringUtil;
import com.intellij.refactoring.util.EnumConstantsUtil;
import com.intellij.refactoring.util.RefactoringChangeUtil;
@@ -447,7 +433,7 @@ public abstract class BaseExpressionToFieldHandler extends IntroduceHandlerBase
final PsiExpression rExpression = expr.getRExpression();
LOG.assertTrue(rExpression != null);
rExpression.replace(initializerExpr);
final PsiReferenceExpression fieldReference = RenameJavaVariableProcessor.createMemberReference(field, context);
final PsiReferenceExpression fieldReference = RenameJavaMemberProcessor.createMemberReference(field, context);
expr.getLExpression().replace(fieldReference);
return statement;

View File

@@ -1,23 +1,9 @@
/*
* 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.refactoring.move.moveClassesOrPackages;
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.ProjectRootManager;
import com.intellij.openapi.vfs.VirtualFile;
@@ -98,7 +84,7 @@ public class AutocreatingSingleSourceRootMoveDestination extends AutocreatingMov
@Override
public boolean isTargetAccessible(Project project, VirtualFile place) {
final boolean inTestSourceContent = ProjectRootManager.getInstance(project).getFileIndex().isInTestSourceContent(place);
final Module module = ModuleUtil.findModuleForFile(place, project);
final Module module = ModuleUtilCore.findModuleForFile(place, project);
if (mySourceRoot != null &&
module != null &&
!GlobalSearchScope.moduleWithDependenciesAndLibrariesScope(module, inTestSourceContent).contains(mySourceRoot)) {

View File

@@ -1,11 +1,11 @@
// 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.refactoring.move.moveClassesOrPackages;
import com.intellij.ide.util.DirectoryChooser;
import com.intellij.openapi.editor.event.DocumentEvent;
import com.intellij.openapi.editor.event.DocumentListener;
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.JavaProjectRootsUtil;
import com.intellij.openapi.roots.ProjectFileIndex;
@@ -71,7 +71,7 @@ public abstract class DestinationFolderComboBox extends ComboboxWithBrowseButton
if (element == NULL_WRAPPER) return LEAVE_IN_SAME_SOURCE_ROOT;
if (element instanceof DirectoryChooser.ItemWrapper) {
final VirtualFile virtualFile = ((DirectoryChooser.ItemWrapper)element).getDirectory().getVirtualFile();
final Module module = ModuleUtil.findModuleForFile(virtualFile, project);
final Module module = ModuleUtilCore.findModuleForFile(virtualFile, project);
if (module != null) {
return module.getName();
}
@@ -289,7 +289,7 @@ public abstract class DestinationFolderComboBox extends ComboboxWithBrowseButton
final VirtualFile virtualFile,
final VirtualFile targetVirtualFile) {
final boolean inTestSourceContent = ProjectRootManager.getInstance(project).getFileIndex().isInTestSourceContent(virtualFile);
final Module module = ModuleUtil.findModuleForFile(virtualFile, project);
final Module module = ModuleUtilCore.findModuleForFile(virtualFile, project);
if (targetVirtualFile != null &&
module != null &&
!GlobalSearchScope.moduleWithDependenciesAndLibrariesScope(module, inTestSourceContent).contains(targetVirtualFile)) {

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.refactoring.move.moveClassesOrPackages;
import com.intellij.ide.util.DirectoryChooserUtil;
@@ -26,7 +12,7 @@ import com.intellij.openapi.roots.ProjectFileIndex;
import com.intellij.openapi.roots.ProjectRootManager;
import com.intellij.openapi.util.Comparing;
import com.intellij.openapi.util.TextRange;
import com.intellij.openapi.vfs.VfsUtil;
import com.intellij.openapi.vfs.VfsUtilCore;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.psi.*;
import com.intellij.psi.search.GlobalSearchScope;
@@ -185,7 +171,7 @@ public class MoveClassesOrPackagesUtil {
}
final PsiDirectory subdirectoryInDest;
final boolean isSourceRoot = RefactoringUtil.isSourceRoot(dir);
if (VfsUtil.isAncestor(sourceVFile, destVFile, false) || isSourceRoot) {
if (VfsUtilCore.isAncestor(sourceVFile, destVFile, false) || isSourceRoot) {
PsiDirectory exitsingSubdir = destination.findSubdirectory(targetName);
if (exitsingSubdir == null) {
subdirectoryInDest = destination.createSubdirectory(targetName);
@@ -273,7 +259,7 @@ public class MoveClassesOrPackagesUtil {
if (newPackage != null && file instanceof PsiClassOwner && !FileTypeUtils.isInServerPageFile(file) &&
!PsiUtil.isModuleFile(file)) {
String qualifiedName = newPackage.getQualifiedName();
if (!Comparing.strEqual(qualifiedName, ((PsiClassOwner)file).getPackageName()) &&
if (!Comparing.strEqual(qualifiedName, ((PsiClassOwner)file).getPackageName()) &&
(qualifiedName.isEmpty() || PsiNameHelper.getInstance(file.getProject()).isQualifiedName(qualifiedName))) {
// Do not rely on class instance identity retention after setPackageName (Scala)
String aClassName = aClass.getName();
@@ -370,7 +356,7 @@ public class MoveClassesOrPackagesUtil {
for (VirtualFile root : contentSourceRoots) {
if (!root.isDirectory()) continue;
for (PsiDirectory directory : directories) {
if (VfsUtil.isAncestor(root, directory.getVirtualFile(), false)) {
if (VfsUtilCore.isAncestor(root, directory.getVirtualFile(), false)) {
targetDirectories.add(directory);
continue sourceRoots;
}

View File

@@ -1,23 +1,9 @@
/*
* 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.refactoring.move.moveClassesOrPackages;
import com.intellij.openapi.diagnostic.Logger;
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.ProjectRootManager;
import com.intellij.openapi.vfs.VirtualFile;
@@ -90,7 +76,7 @@ public class SingleSourceRootMoveDestination implements MoveDestination {
@Override
public boolean isTargetAccessible(Project project, VirtualFile place) {
final boolean inTestSourceContent = ProjectRootManager.getInstance(project).getFileIndex().isInTestSourceContent(place);
final Module module = ModuleUtil.findModuleForFile(place, project);
final Module module = ModuleUtilCore.findModuleForFile(place, project);
final VirtualFile targetVirtualFile = myTargetDirectory.getVirtualFile();
if (module != null &&
!GlobalSearchScope.moduleWithDependenciesAndLibrariesScope(module, inTestSourceContent).contains(targetVirtualFile)) {

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.refactoring.util;
import com.intellij.codeInsight.ExpectedTypeInfo;
@@ -18,7 +18,7 @@ import com.intellij.openapi.project.Project;
import com.intellij.openapi.roots.ProjectRootManager;
import com.intellij.openapi.util.*;
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.psi.*;
import com.intellij.psi.codeStyle.CodeStyleManager;
@@ -381,7 +381,7 @@ public class RefactoringUtil {
if (infos.length > 0) {
type = infos[0].getType();
if (type instanceof PsiPrimitiveType) {
type = infos.length > 1 && !(infos[1].getType() instanceof PsiPrimitiveType) ? infos[1].getType()
type = infos.length > 1 && !(infos[1].getType() instanceof PsiPrimitiveType) ? infos[1].getType()
: ((PsiPrimitiveType)type).getBoxedType(expr);
}
}
@@ -1210,7 +1210,7 @@ public class RefactoringUtil {
throws IncorrectOperationException {
final PsiDirectory[] directories = aPackage.getDirectories();
for (PsiDirectory directory : directories) {
if (VfsUtil.isAncestor(sourceRoot, directory.getVirtualFile(), false)) {
if (VfsUtilCore.isAncestor(sourceRoot, directory.getVirtualFile(), false)) {
return directory;
}
}
@@ -1252,7 +1252,7 @@ public class RefactoringUtil {
public static PsiDirectory findPackageDirectoryInSourceRoot(PackageWrapper aPackage, final VirtualFile sourceRoot) {
final PsiDirectory[] directories = aPackage.getDirectories();
for (PsiDirectory directory : directories) {
if (VfsUtil.isAncestor(sourceRoot, directory.getVirtualFile(), false)) {
if (VfsUtilCore.isAncestor(sourceRoot, directory.getVirtualFile(), false)) {
return directory;
}
}

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.ide.structureView.impl.java;
import com.intellij.ide.structureView.StructureViewTreeElement;
@@ -29,7 +15,7 @@ import com.intellij.psi.impl.light.LightElement;
import com.intellij.psi.search.searches.SuperMethodsSearch;
import com.intellij.psi.util.MethodSignatureBackedByPsiMethod;
import com.intellij.psi.util.PsiFormatUtil;
import com.intellij.util.ui.UIUtil;
import com.intellij.util.ui.StartupUiUtil;
import org.jetbrains.annotations.NotNull;
import java.util.ArrayList;
@@ -80,9 +66,9 @@ public class PsiMethodTreeElement extends JavaClassTreeElementBase<PsiMethod> im
final PsiMethod psiMethod = getElement();
if (psiMethod == null) return "";
final boolean dumb = DumbService.isDumb(psiMethod.getProject());
String method = PsiFormatUtil.formatMethod(psiMethod,
String method = PsiFormatUtil.formatMethod(psiMethod,
PsiSubstitutor.EMPTY,
SHOW_NAME | TYPE_AFTER | SHOW_PARAMETERS | (dumb ? 0 : SHOW_TYPE),
SHOW_NAME | TYPE_AFTER | SHOW_PARAMETERS | (dumb ? 0 : SHOW_TYPE),
dumb ? SHOW_NAME : SHOW_TYPE);
return StringUtil.replace(method, ":", ": ");
}
@@ -116,7 +102,7 @@ public class PsiMethodTreeElement extends JavaClassTreeElementBase<PsiMethod> im
myLocation = "";
} else {
char upArrow = '\u2191';
myLocation = UIUtil.getLabelFont().canDisplay(upArrow) ? upArrow + myLocation : myLocation;
myLocation = StartupUiUtil.getLabelFont().canDisplay(upArrow) ? upArrow + myLocation : myLocation;
}
}
}

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.java.psi;
import com.intellij.openapi.application.ApplicationManager;
@@ -24,6 +10,7 @@ import com.intellij.openapi.roots.LanguageLevelProjectExtension;
import com.intellij.openapi.roots.impl.PushedFilePropertiesUpdater;
import com.intellij.openapi.util.Conditions;
import com.intellij.openapi.vfs.VfsUtil;
import com.intellij.openapi.vfs.VfsUtilCore;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.pom.java.LanguageLevel;
import com.intellij.psi.*;
@@ -104,7 +91,7 @@ public class MiscPsiTest extends LightCodeInsightFixtureTestCase {
PsiFile newFile = (PsiFile)dir.add(fileCopy);
assertInstanceOf(newFile, PsiPlainTextFile.class);
assertEquals(text, VfsUtil.loadText(newFile.getVirtualFile()));
assertEquals(text, VfsUtilCore.loadText(newFile.getVirtualFile()));
assertEquals(newFile.getVirtualFile().getModificationStamp(), newFile.getViewProvider().getModificationStamp());
assertFalse(FileDocumentManager.getInstance().isFileModified(newFile.getVirtualFile()));
}
@@ -356,7 +343,7 @@ public class MiscPsiTest extends LightCodeInsightFixtureTestCase {
catch (Throwable e) {
assertTrue(e.getMessage(), e.getMessage().contains("Wrong line separators"));
}
assertEquals("class A{}", getPsiManager().findFile(vFile).getText());
VfsUtil.saveText(vFile, "class C {}");

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.java.psi;
import com.intellij.openapi.application.ApplicationManager;
@@ -24,7 +10,7 @@ import com.intellij.psi.JavaDirectoryService;
import com.intellij.psi.PsiDirectory;
import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiFile;
import com.intellij.psi.util.PsiUtilBase;
import com.intellij.psi.util.PsiUtilCore;
import com.intellij.testFramework.PsiTestCase;
import com.intellij.testFramework.PsiTestUtil;
@@ -109,7 +95,7 @@ public class OverlappingSourceRootsTest extends PsiTestCase {
}
private PsiDirectory findSourceRootDirectory(PsiElement element) {
final VirtualFile virtualFile = PsiUtilBase.getVirtualFile(element);
final VirtualFile virtualFile = PsiUtilCore.getVirtualFile(element);
final VirtualFile sourceRoot = ProjectRootManager.getInstance(myProject).getFileIndex().getSourceRootForFile(virtualFile);
return myPsiManager.findDirectory(sourceRoot);
}

View File

@@ -18,7 +18,7 @@ import com.intellij.openapi.roots.ModifiableRootModel;
import com.intellij.openapi.roots.ModuleRootManager;
import com.intellij.openapi.roots.ModuleRootModificationUtil;
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.psi.PsiClass;
import com.intellij.psi.PsiDocumentManager;
@@ -127,7 +127,7 @@ public class FindClassTest extends PsiTestCase {
FileDocumentManager.getInstance().saveAllDocuments();
PsiClass psiClass = myJavaFacade.findClass("p.A");
final VirtualFile vFile = psiClass.getContainingFile().getVirtualFile();
File ioFile = VfsUtil.virtualToIoFile(vFile);
File ioFile = VfsUtilCore.virtualToIoFile(vFile);
ioFile.setLastModified(5);
LocalFileSystem.getInstance().refresh(false);

View File

@@ -1,23 +1,9 @@
/*
* 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.java.psi.impl.cache.impl;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.module.Module;
import com.intellij.openapi.module.ModuleUtil;
import com.intellij.openapi.module.ModuleUtilCore;
import com.intellij.openapi.vfs.LocalFileSystem;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.psi.PsiClass;
@@ -68,14 +54,14 @@ public class SameSourceRootInTwoModulesTest extends PsiTestCase {
assertEquals(psiFile, psiClass.getContainingFile());
VirtualFile file = psiFile.getVirtualFile();
assertEquals(myModule, ModuleUtil.findModuleForFile(file, myProject));
assertEquals(myModule, ModuleUtilCore.findModuleForFile(file, myProject));
Module anotherModule = createModule("another");
myFilesToDelete.add(new File(anotherModule.getModuleFilePath()));
PsiTestUtil.addSourceRoot(anotherModule, mySrcDir1);
assertEquals(anotherModule, ModuleUtil.findModuleForFile(file, myProject));
assertEquals(anotherModule, ModuleUtilCore.findModuleForFile(file, myProject));
});
}
}

View File

@@ -198,7 +198,7 @@ public class SliceTreeTest extends SliceTestCase {
public void testNullness() throws Exception {
SliceTreeStructure treeStructure = configureTree("Nulls");
final SliceRootNode root = (SliceRootNode)treeStructure.getRootElement();
Map<SliceNode, JavaSliceNullnessAnalyzer.NullAnalysisResult> map = JavaSliceNullnessAnalyzer.createMap();
Map<SliceNode, JavaSliceNullnessAnalyzer.NullAnalysisResult> map = SliceNullnessAnalyzerBase.createMap();
JavaSliceNullnessAnalyzer analyzer = new JavaSliceNullnessAnalyzer();
JavaSliceNullnessAnalyzer.NullAnalysisResult leaves = analyzer.calcNullableLeaves(root, treeStructure, map);
@@ -319,7 +319,7 @@ public class SliceTreeTest extends SliceTestCase {
public void testDoubleNullness() throws Exception {
SliceTreeStructure treeStructure = configureTree("DoubleNulls");
final SliceRootNode root = (SliceRootNode)treeStructure.getRootElement();
Map<SliceNode, JavaSliceNullnessAnalyzer.NullAnalysisResult> map = JavaSliceNullnessAnalyzer.createMap();
Map<SliceNode, JavaSliceNullnessAnalyzer.NullAnalysisResult> map = SliceNullnessAnalyzerBase.createMap();
JavaSliceNullnessAnalyzer analyzer = new JavaSliceNullnessAnalyzer();
JavaSliceNullnessAnalyzer.NullAnalysisResult leaves = analyzer.calcNullableLeaves(root, treeStructure, map);

View File

@@ -1,22 +1,9 @@
/*
* 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 jetbrains.antlayout.datatypes;
import org.apache.tools.ant.Main;
import org.apache.tools.ant.taskdefs.*;
import org.apache.tools.ant.types.EnumeratedAttribute;
import org.apache.tools.ant.types.ZipFileSet;
import java.io.File;
@@ -36,7 +23,7 @@ public class JarContainer extends ZipContainer {
task = new Jar();
}
task.setTaskName("jar");
task.setWhenmanifestonly((Zip.WhenEmpty) Zip.WhenEmpty.getInstance(Zip.WhenEmpty.class, "skip"));
task.setWhenmanifestonly((Zip.WhenEmpty)EnumeratedAttribute.getInstance(Zip.WhenEmpty.class, "skip"));
return task;
}

View File

@@ -3,7 +3,7 @@
package com.intellij.ui;
import com.intellij.util.ui.JBUI;
import com.intellij.util.ui.UIUtil;
import com.intellij.util.ui.StartupUiUtil;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -15,7 +15,7 @@ import java.awt.event.MouseEvent;
public class CaptionPanel extends JPanel {
public static final Color CNT_ACTIVE_COLOR = new JBColor(Gray._202, Gray._55);
public static final Color CNT_ACTIVE_BORDER_COLOR = new JBColor(() -> UIUtil.isUnderDarcula() ? JBColor.border() : CNT_ACTIVE_COLOR);
public static final Color CNT_ACTIVE_BORDER_COLOR = new JBColor(() -> StartupUiUtil.isUnderDarcula() ? JBColor.border() : CNT_ACTIVE_COLOR);
/**
* @deprecated use {@link JBUI.CurrentTheme.Popup#borderColor} instead,

View File

@@ -2,6 +2,7 @@
package com.intellij.ui;
import com.intellij.util.containers.ContainerUtil;
import com.intellij.util.ui.StartupUiUtil;
import com.intellij.util.ui.UIUtil;
import org.jetbrains.annotations.NonNls;
@@ -73,7 +74,7 @@ public class CollapsiblePanel extends JPanel {
0));
if (title != null) {
myTitleLabel = new Label(title);
myTitleLabel.setFont(UIUtil.getLabelFont().deriveFont(Font.BOLD));
myTitleLabel.setFont(StartupUiUtil.getLabelFont().deriveFont(Font.BOLD));
myTitleLabel.setBackground(content.getBackground());
add(myTitleLabel,
new GridBagConstraints(0, 0, 1, 1, 1.0, 0.0,

View File

@@ -5,7 +5,7 @@
*/
package com.intellij.ui;
import com.intellij.util.ui.UIUtil;
import com.intellij.util.ui.StartupUiUtil;
import javax.swing.*;
import java.awt.*;
@@ -27,7 +27,7 @@ public class EngravedLabel extends JLabel {
@Override
protected void paintComponent(Graphics graphics) {
if (!UIUtil.isUnderDarcula()) {
if (!StartupUiUtil.isUnderDarcula()) {
graphics = new EngravedTextGraphics((Graphics2D)graphics, 0, 1, getShadowColor());
}
super.paintComponent(graphics);

View File

@@ -3,6 +3,7 @@ package com.intellij.ui;
import com.intellij.util.NotNullProducer;
import com.intellij.util.ui.JBUI;
import com.intellij.util.ui.StartupUiUtil;
import com.intellij.util.ui.UIUtil;
import org.jetbrains.annotations.NotNull;
@@ -25,7 +26,7 @@ public class JBColor extends Color {
public static final Color PanelBackground = namedColor("Panel.background", 0xffffff);
private static class Lazy {
private static volatile boolean DARK = UIUtil.isUnderDarcula();
private static volatile boolean DARK = StartupUiUtil.isUnderDarcula();
}
private final Color darkColor;
@@ -322,7 +323,7 @@ public class JBColor extends Color {
private static final Map<String, Color> defaultThemeColors = new HashMap<>();
@NotNull
@NotNull
public static Color get(@NotNull final String colorId, @NotNull final Color defaultColor) {
return new JBColor(() -> {
Color color = defaultThemeColors.get(colorId);

View File

@@ -6,7 +6,7 @@ import com.intellij.ui.paint.PaintUtil.ParityMode;
import com.intellij.ui.paint.PaintUtil.RoundingMode;
import com.intellij.util.ui.JBUIScale.ScaleContext;
import com.intellij.util.ui.JBUIScale.ScaleType;
import com.intellij.util.ui.UIUtil;
import com.intellij.util.ui.StartupUiUtil;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull;
@@ -266,7 +266,7 @@ public class LinePainter2D {
@NotNull Object valueAA)
{
double x1, x2, y1, y2;
boolean thickPixel = UIUtil.isJreHiDPIEnabled() && PaintUtil.devValue(strokeWidth, g) > 1;
boolean thickPixel = StartupUiUtil.isJreHiDPIEnabled() && PaintUtil.devValue(strokeWidth, g) > 1;
boolean prevStraight = nPoints <= 1 || isStraightLine(xPoints, yPoints, nPoints, nPoints);
for (int p = 0; p < nPoints; p++) {

View File

@@ -1,7 +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.
package com.intellij.util;
import com.intellij.util.ui.UIUtil;
import com.intellij.util.ui.StartupUiUtil;
import org.jetbrains.annotations.NotNull;
import java.awt.*;
@@ -36,7 +36,7 @@ public class FontUtil {
@NotNull
public static String thinSpace() {
return canDisplay(UIUtil.getLabelFont(), '\u2009', " ");
return canDisplay(StartupUiUtil.getLabelFont(), '\u2009', " ");
}
@NotNull

View File

@@ -14,7 +14,7 @@ import com.intellij.util.ui.EmptyIcon;
import com.intellij.util.ui.ImageUtil;
import com.intellij.util.ui.JBUI;
import com.intellij.util.ui.JBUIScale.ScaleContext;
import com.intellij.util.ui.UIUtil;
import com.intellij.util.ui.StartupUiUtil;
import org.apache.xmlgraphics.java2d.Dimension2DDouble;
import org.imgscalr.Scalr;
import org.intellij.lang.annotations.MagicConstant;
@@ -428,7 +428,7 @@ public final class ImageLoader implements Serializable {
if (useCache) {
flags |= USE_CACHE;
}
if (UIUtil.isUnderDarcula()) {
if (StartupUiUtil.isUnderDarcula()) {
flags |= DARK;
}
return loadFromUrl(url, null, flags, filters, ctx);
@@ -526,7 +526,7 @@ public final class ImageLoader implements Serializable {
public static Image loadFromResource(@NonNls @NotNull String path, @NotNull Class aClass) {
ScaleContext scaleContext = ScaleContext.create();
int flags = FIND_SVG | ALLOW_FLOAT_SCALING;
if (UIUtil.isUnderDarcula()) {
if (StartupUiUtil.isUnderDarcula()) {
flags |= DARK;
}
return ImageDescriptorList.create(path, flags, scaleContext)

View File

@@ -70,7 +70,7 @@ public class AppleBoldDottedPainter {
try {
g.setComposite(AlphaComposite.SrcOver);
g.setClip(lineClip);
UIUtil.drawImage(g, myImage, dotX0, y, null);
StartupUiUtil.drawImage(g, myImage, dotX0, y, null);
}
finally {
g.setComposite(oldComposite);

View File

@@ -131,7 +131,7 @@ public class ImageUtil {
@Contract("null, _ -> null; !null, _ -> !null")
public static Image ensureHiDPI(@Nullable Image image, @NotNull ScaleContext ctx) {
if (image == null) return null;
if (UIUtil.isJreHiDPI(ctx)) {
if (StartupUiUtil.isJreHiDPI(ctx)) {
return RetinaImage.createFrom(image, ctx.getScale(SYS_SCALE), null);
}
return image;
@@ -162,7 +162,7 @@ public class ImageUtil {
@Contract("null, _, _, _ -> null; !null, _, _, _ -> !null")
public static Image ensureHiDPI(@Nullable Image image, @NotNull ScaleContext ctx, double userWidth, double userHeight) {
if (image == null) return null;
if (UIUtil.isJreHiDPI(ctx)) {
if (StartupUiUtil.isJreHiDPI(ctx)) {
return new JBHiDPIScaledImage(image, userWidth, userHeight, BufferedImage.TYPE_INT_ARGB);
}
return image;

View File

@@ -21,6 +21,6 @@ public class JBImageIcon extends ImageIcon {
public synchronized void paintIcon(final Component c, final Graphics g, final int x, final int y) {
final ImageObserver observer = getImageObserver();
UIUtil.drawImage(g, getImage(), x, y, observer == null ? c : observer);
StartupUiUtil.drawImage(g, getImage(), x, y, observer == null ? c : observer);
}
}

View File

@@ -631,7 +631,7 @@ public class JBUIScale {
@Override
public double getScale(@NotNull DerivedScaleType type) {
switch (type) {
case DEV_SCALE: return UIUtil.isJreHiDPIEnabled() ? sysScale.value : 1;
case DEV_SCALE: return StartupUiUtil.isJreHiDPIEnabled() ? sysScale.value : 1;
case EFF_USR_SCALE: return usrScale.value * objScale.value;
case PIX_SCALE: return pixScale;
}

View File

@@ -127,7 +127,7 @@ public interface RegionPainter<T> {
updateImage(myImage);
}
if (myImage != null) {
UIUtil.drawImage(g, myImage, null, x, y);
StartupUiUtil.drawImage(g, myImage, null, x, y);
}
}
}

View File

@@ -120,7 +120,8 @@ public class ThreeStateCheckBox extends JCheckBox {
@Override
protected void paintComponent(Graphics g) {
super.paintComponent(g);
if (UIUtil.isUnderAquaLookAndFeel() || UIUtil.isUnderDefaultMacTheme() || UIUtil.isUnderWin10LookAndFeel() || UIUtil.isUnderDarcula() || UIUtil.isUnderIntelliJLaF()) {
if (UIUtil.isUnderAquaLookAndFeel() || UIUtil.isUnderDefaultMacTheme() || UIUtil.isUnderWin10LookAndFeel() ||
StartupUiUtil.isUnderDarcula() || UIUtil.isUnderIntelliJLaF()) {
return;
}
@@ -129,7 +130,7 @@ public class ThreeStateCheckBox extends JCheckBox {
if (icon == null) {
icon = UIManager.getIcon("CheckBox.icon");
}
if (UIUtil.isUnderDarcula() || UIUtil.isUnderIntelliJLaF()) {
if (StartupUiUtil.isUnderDarcula() || UIUtil.isUnderIntelliJLaF()) {
icon = JBUI.scale(EmptyIcon.create(20, 18));
}
if (icon != null) {

View File

@@ -66,7 +66,7 @@ public class WavePainter2D extends WavePainter {
g2d.setClip(waveClip);
xStart -= xStart % 4;
g2d.translate(xStart, y - 3);
UIUtil.drawImage(g2d, myImage, 0, 0, null);
StartupUiUtil.drawImage(g2d, myImage, 0, 0, null);
} finally {
g2d.dispose();
}

View File

@@ -7,6 +7,7 @@ import com.intellij.openapi.util.Conditions;
import com.intellij.openapi.util.registry.Registry;
import com.intellij.util.ui.JBUI;
import com.intellij.util.ui.MouseEventAdapter;
import com.intellij.util.ui.StartupUiUtil;
import com.intellij.util.ui.UIUtil;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
@@ -229,7 +230,7 @@ public class WideSelectionTreeUI extends BasicTreeUI {
}
private boolean shouldPaintLines() {
if (UIUtil.isUnderAquaBasedLookAndFeel() || UIUtil.isUnderDarcula() || UIUtil.isUnderIntelliJLaF()) {
if (UIUtil.isUnderAquaBasedLookAndFeel() || StartupUiUtil.isUnderDarcula() || UIUtil.isUnderIntelliJLaF()) {
return false;
}
return myForceDontPaintLines || !"None".equals(tree.getClientProperty("JTree.lineStyle"));
@@ -304,7 +305,7 @@ public class WideSelectionTreeUI extends BasicTreeUI {
}
}
else {
if (selected && (UIUtil.isUnderAquaBasedLookAndFeel() || UIUtil.isUnderDarcula() || UIUtil.isUnderIntelliJLaF())) {
if (selected && (UIUtil.isUnderAquaBasedLookAndFeel() || StartupUiUtil.isUnderDarcula() || UIUtil.isUnderIntelliJLaF())) {
Color bg = getSelectionBackground(tree, true);
if (myWideSelectionCondition.value(row)) {
@@ -328,7 +329,7 @@ public class WideSelectionTreeUI extends BasicTreeUI {
@Override
public void paint(Graphics g, JComponent c) {
if (myWideSelection && !UIUtil.isUnderAquaBasedLookAndFeel() && !UIUtil.isUnderDarcula() && !UIUtil.isUnderIntelliJLaF()) {
if (myWideSelection && !UIUtil.isUnderAquaBasedLookAndFeel() && !StartupUiUtil.isUnderDarcula() && !UIUtil.isUnderIntelliJLaF()) {
paintSelectedRows(g, ((JTree)c));
}
if (myWideSelection) {

View File

@@ -1,22 +1,8 @@
/*
* 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.jetbrains.python.psi.impl;
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.psi.PsiClass;
import com.intellij.psi.PsiElement;
@@ -36,7 +22,7 @@ public class PyJavaImportCandidateProvider implements PyImportCandidateProvider
public void addImportCandidates(PsiReference reference, String name, AutoImportQuickFix quickFix) {
final PsiElement element = reference.getElement();
final Project project = element.getProject();
Module module = ModuleUtil.findModuleForPsiElement(element);
Module module = ModuleUtilCore.findModuleForPsiElement(element);
GlobalSearchScope scope = module == null ? ProjectScope.getAllScope(project) : module.getModuleWithDependenciesAndLibrariesScope(false);
PsiShortNamesCache cache = PsiShortNamesCache.getInstance(project);
final PsiClass[] classesByName = cache.getClassesByName(name, scope);

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.jetbrains.rest.run.docutils;
import com.intellij.execution.Location;
@@ -6,7 +6,7 @@ import com.intellij.execution.RunnerAndConfigurationSettings;
import com.intellij.execution.actions.ConfigurationContext;
import com.intellij.execution.junit.RuntimeConfigurationProducer;
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.util.io.FileUtil;
import com.intellij.openapi.vfs.LocalFileSystem;
@@ -40,7 +40,7 @@ public class DocutilsConfigurationProducer extends RuntimeConfigurationProducer
if (script == null || script.getFileType() != RestFileType.INSTANCE) {
return null;
}
Module module = ModuleUtil.findModuleForPsiElement(script);
Module module = ModuleUtilCore.findModuleForPsiElement(script);
storeSourceElement(script);
final Project project = script.getProject();

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.jetbrains.rest.run.sphinx;
import com.intellij.execution.Location;
@@ -6,7 +6,7 @@ import com.intellij.execution.RunnerAndConfigurationSettings;
import com.intellij.execution.actions.ConfigurationContext;
import com.intellij.execution.junit.RuntimeConfigurationProducer;
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.util.io.FileUtil;
import com.intellij.openapi.vfs.VirtualFile;
@@ -65,7 +65,7 @@ public class SphinxConfigurationProducer extends RuntimeConfigurationProducer im
configuration.setWorkingDirectory(parent.getPath());
}
configuration.setName(configuration.suggestedName());
Module module = ModuleUtil.findModuleForPsiElement(element);
Module module = ModuleUtilCore.findModuleForPsiElement(element);
if (module != null) {
configuration.setUseModuleSdk(true);
configuration.setModule(module);

View File

@@ -5,7 +5,7 @@ import com.intellij.lang.xml.XMLLanguage;
import com.intellij.openapi.fileTypes.INativeFileType;
import com.intellij.openapi.fileTypes.LanguageFileType;
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.projectRoots.Sdk;
import com.intellij.openapi.ui.Messages;
@@ -76,7 +76,7 @@ public abstract class QtFileType extends LanguageFileType implements INativeFile
@Override
public boolean openFileInAssociatedApplication(Project project, @NotNull VirtualFile file) {
String qtTool = findQtTool(ModuleUtil.findModuleForFile(file, project), getToolName());
String qtTool = findQtTool(ModuleUtilCore.findModuleForFile(file, project), getToolName());
if (qtTool == null) {
return false;
}

View File

@@ -198,7 +198,7 @@ public class BuildoutFacet extends LibraryContributingFacet<BuildoutFacetConfigu
*/
@Nullable
public static List<String> extractFromScript(@NotNull VirtualFile script) throws IOException {
String text = VfsUtil.loadText(script);
String text = VfsUtilCore.loadText(script);
Pattern pat = Pattern.compile("(?:^\\s*(['\"])(.*)(\\1),\\s*$)|(\\])", Pattern.MULTILINE);
final String bait_string = "sys.path[0:0]";
int pos = text.indexOf(bait_string);
@@ -231,7 +231,7 @@ public class BuildoutFacet extends LibraryContributingFacet<BuildoutFacetConfigu
*/
public static List<String> extractFromSitePy(VirtualFile vFile) throws IOException {
List<String> result = new ArrayList<>();
String text = VfsUtil.loadText(vFile);
String text = VfsUtilCore.loadText(vFile);
String[] lines = LineTokenizer.tokenize(text, false);
int index = 0;
while (index < lines.length && !lines[index].startsWith("def addsitepackages(")) {

View File

@@ -137,9 +137,9 @@ public class PyProjectScopeBuilder extends ProjectScopeBuilderImpl {
}
private static GlobalSearchScope buildUnionScope(Project project, List<VirtualFile> testDirs) {
GlobalSearchScope scope = GlobalSearchScopes.directoryScope(project, testDirs.get(0), true);
GlobalSearchScope scope = GlobalSearchScopesCore.directoryScope(project, testDirs.get(0), true);
for (int i = 1; i < testDirs.size(); i++) {
scope = scope.union(GlobalSearchScopes.directoryScope(project, testDirs.get(i), true));
scope = scope.union(GlobalSearchScopesCore.directoryScope(project, testDirs.get(i), true));
}
return scope;
}

View File

@@ -2028,11 +2028,11 @@ public class PythonDebuggerTest extends PyEnvTestCase {
}
private void loadEnvTags() {
List<String> roots = PythonDebuggerTest.getPythonRoots();
List<String> roots = PyEnvTestCase.getPythonRoots();
roots.forEach((root) -> {
Set<String> tags = Sets.newHashSet();
tags.addAll(PythonDebuggerTest.loadEnvTags(root));
tags.addAll(PyEnvTestCase.loadEnvTags(root));
myEnvTags.put(root, tags);
});
}

View File

@@ -1,22 +1,8 @@
/*
* 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 com.jetbrains.python.fixtures;
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.psi.PsiElement;
import com.intellij.psi.PsiFile;
@@ -66,7 +52,7 @@ public abstract class LightMarkedTestCase extends PyTestCase {
final String text;
try {
text = VfsUtil.loadText(vFile);
text = VfsUtilCore.loadText(vFile);
}
catch (IOException e) {
throw new RuntimeException(e);

View File

@@ -1,11 +1,11 @@
// 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.jetbrains.python.fixtures;
import com.intellij.openapi.editor.Document;
import com.intellij.openapi.util.Ref;
import com.intellij.openapi.util.text.StringUtil;
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.openapi.vfs.ex.temp.TempFileSystem;
import com.intellij.psi.*;
@@ -33,7 +33,7 @@ public abstract class PyResolveTestCase extends PyTestCase {
String fileText;
try {
fileText = StringUtil.convertLineSeparators(VfsUtil.loadText(file));
fileText = StringUtil.convertLineSeparators(VfsUtilCore.loadText(file));
}
catch (IOException e) {
throw new RuntimeException(e);

View File

@@ -1,25 +1,11 @@
/*
* 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.jetbrains.python.refactoring;
import com.intellij.codeInsight.codeFragment.CannotCreateCodeFragmentException;
import com.intellij.codeInsight.codeFragment.CodeFragment;
import com.intellij.openapi.util.Pair;
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.psi.PsiElement;
import com.intellij.psi.util.PsiTreeUtil;
@@ -49,7 +35,7 @@ public class PyCodeFragmentTest extends LightMarkedTestCase {
final String fullPath = getTestDataPath() + testName + ".test";
final VirtualFile vFile = getVirtualFileByName(fullPath);
String fileText = StringUtil.convertLineSeparators(VfsUtil.loadText(vFile), "\n");
String fileText = StringUtil.convertLineSeparators(VfsUtilCore.loadText(vFile), "\n");
final int beginMarker = fileText.indexOf(BEGIN_MARKER);
final int endMarker = fileText.indexOf(END_MARKER);

View File

@@ -1,23 +1,9 @@
/*
* 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.util.xml.model.impl;
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.psi.PsiElement;
import com.intellij.psi.xml.XmlFile;
@@ -43,7 +29,7 @@ public abstract class DomModelFactory<T extends DomElement, M extends DomModel<T
@Override
protected Module getModelScope(final XmlFile file) {
return ModuleUtil.findModuleForPsiElement(file);
return ModuleUtilCore.findModuleForPsiElement(file);
}
@NotNull

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.codeInsight.editorActions;
import com.intellij.application.options.editor.WebEditorOptions;
@@ -96,7 +82,7 @@ public class XmlSlashTypedHandler extends TypedHandlerDelegate {
if (tag != null && StringUtil.isNotEmpty(tag.getName()) && TreeUtil.findSibling(prevLeaf, XmlTokenType.XML_NAME) == null) {
// check for template language like JSP
if (provider instanceof MultiplePsiFilesPerDocumentFileViewProvider) {
PsiElement element1 = SingleRootFileViewProvider.findElementAt(file, offset - 1);
PsiElement element1 = AbstractFileViewProvider.findElementAt(file, offset - 1);
if (element1 != null) {
// case of top-level jsp tag
XmlTag tag1 = PsiTreeUtil.getParentOfType(element1, XmlTag.class);

View File

@@ -28,7 +28,7 @@ import com.intellij.openapi.roots.ProjectRootManager;
import com.intellij.openapi.ui.ComponentWithBrowseButton;
import com.intellij.openapi.ui.TextComponentAccessor;
import com.intellij.openapi.ui.TextFieldWithBrowseButton;
import com.intellij.openapi.vfs.VfsUtil;
import com.intellij.openapi.vfs.VfsUtilCore;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.psi.PsiFile;
import org.intellij.plugins.relaxNG.compact.RncFileType;
@@ -120,12 +120,12 @@ class NoNamespaceConfigPanel extends HectorComponentPanel {
private String getMapping() {
final String s = mySchemaFile.getText().trim();
return s.length() > 0 ? VfsUtil.pathToUrl(s.replace(File.separatorChar, '/')) : null;
return s.length() > 0 ? VfsUtilCore.pathToUrl(s.replace(File.separatorChar, '/')) : null;
}
@Override
public void reset() {
mySchemaFile.setText(myMapping != null ? VfsUtil.urlToPath(myMapping).replace('/', File.separatorChar) : "");
mySchemaFile.setText(myMapping != null ? VfsUtilCore.urlToPath(myMapping).replace('/', File.separatorChar) : "");
}
@Override