IDEA-352824 Support Multiple Projects for Maven and Gradle

workspace icons

GitOrigin-RevId: b6ce3a23538faec1ee69be5374f28661951b37d7
This commit is contained in:
Dmitry Avdeev
2024-05-16 16:01:49 +02:00
committed by intellij-monorepo-bot
parent bc0a67dd04
commit 288650e63f
17 changed files with 98 additions and 12 deletions

View File

@@ -0,0 +1,5 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M2.75 4C1.7835 4 1 4.83574 1 5.86667V12.1333C1 13.1643 1.7835 14 2.75 14H11.25C12.2165 14 13 13.1643 13 12.1333V8C13 6.89543 12.1046 6 11 6L8.5 6L6.73559 4.28327C6.5489 4.10163 6.29871 4 6.03823 4H2.75Z" fill="#EBECF0"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M8.09379 7L6.03823 5H2.75C2.3956 5 2 5.32624 2 5.86667V12.1333C2 12.6738 2.3956 13 2.75 13H11.25C11.6044 13 12 12.6738 12 12.1333V8C12 7.44771 11.5523 7 11 7H8.09379ZM8.5 6L11 6C12.1046 6 13 6.89543 13 8V12.1333C13 13.1643 12.2165 14 11.25 14H2.75C1.7835 14 1 13.1643 1 12.1333V5.86667C1 4.83574 1.7835 4 2.75 4H6.03823C6.29871 4 6.5489 4.10163 6.73559 4.28327L8.5 6Z" fill="#6C707E"/>
<path d="M4 2.5C4 2.77614 4.22386 3 4.5 3L8.03823 3L10.0938 5H13C13.5523 5 14 5.44772 14 6V10.5C14 10.7761 14.2239 11 14.5 11V11C14.7761 11 15 10.7761 15 10.5V6C15 4.89543 14.1046 4 13 4L10.5 4L8.73559 2.28327C8.5489 2.10163 8.29871 2 8.03823 2H4.5C4.22386 2 4 2.22386 4 2.5V2.5Z" fill="#6C707E"/>
</svg>

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@@ -0,0 +1,5 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M2.75 4C1.7835 4 1 4.83574 1 5.86667V12.1333C1 13.1643 1.7835 14 2.75 14H11.25C12.2165 14 13 13.1643 13 12.1333V8C13 6.89543 12.1046 6 11 6L8.5 6L6.73559 4.28327C6.5489 4.10163 6.29871 4 6.03823 4H2.75Z" fill="#43454A"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M8.09379 7L6.03823 5H2.75C2.3956 5 2 5.32624 2 5.86667V12.1333C2 12.6738 2.3956 13 2.75 13H11.25C11.6044 13 12 12.6738 12 12.1333V8C12 7.44771 11.5523 7 11 7H8.09379ZM8.5 6L11 6C12.1046 6 13 6.89543 13 8V12.1333C13 13.1643 12.2165 14 11.25 14H2.75C1.7835 14 1 13.1643 1 12.1333V5.86667C1 4.83574 1.7835 4 2.75 4H6.03823C6.29871 4 6.5489 4.10163 6.73559 4.28327L8.5 6Z" fill="#CED0D6"/>
<path d="M4 2.5C4 2.77614 4.22386 3 4.5 3L8.03823 3L10.0938 5H13C13.5523 5 14 5.44772 14 6V10.5C14 10.7761 14.2239 11 14.5 11V11C14.7761 11 15 10.7761 15 10.5V6C15 4.89543 14.1046 4 13 4L10.5 4L8.73559 2.28327C8.5489 2.10163 8.29871 2 8.03823 2H4.5C4.22386 2 4 2.22386 4 2.5V2.5Z" fill="#CED0D6"/>
</svg>

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@@ -686,6 +686,7 @@ com.intellij.ide.workspace.ImportedProjectSettings
*:com.intellij.ide.workspace.SubprojectHandler
- *sf:Companion:com.intellij.ide.workspace.SubprojectHandler$Companion
- a:canImportFromFile(com.intellij.openapi.project.Project,com.intellij.openapi.vfs.VirtualFile):Z
- a:getSubprojectIcon():javax.swing.Icon
- a:getSubprojects(com.intellij.openapi.project.Project):java.util.List
- a:importFromProject(com.intellij.openapi.project.Project,Z):com.intellij.ide.workspace.ImportedProjectSettings
- a:removeSubprojects(java.util.List):V

View File

@@ -6,6 +6,7 @@ import com.intellij.openapi.module.Module
import com.intellij.openapi.project.Project
import com.intellij.openapi.vfs.VirtualFile
import org.jetbrains.annotations.ApiStatus.Experimental
import javax.swing.Icon
@Experimental
interface SubprojectHandler {
@@ -20,6 +21,8 @@ interface SubprojectHandler {
fun importFromProject(project: Project, newWorkspace: Boolean): ImportedProjectSettings?
fun suppressGenericImportFor(module: Module): Boolean = false
val subprojectIcon: Icon?
}
interface WorkspaceSettingsImporter {

View File

@@ -17325,6 +17325,7 @@ c:com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode
- com.intellij.ide.projectView.impl.nodes.BasePsiNode
- com.intellij.ide.util.treeView.PathElementIdProvider
- com.intellij.pom.NavigatableWithText
- <init>(com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode):V
- <init>(com.intellij.openapi.project.Project,com.intellij.psi.PsiDirectory,com.intellij.ide.projectView.ViewSettings):V
- <init>(com.intellij.openapi.project.Project,com.intellij.psi.PsiDirectory,com.intellij.ide.projectView.ViewSettings,com.intellij.ide.projectView.impl.nodes.PsiFileSystemItemFilter):V
- canNavigate():Z

View File

@@ -62,6 +62,11 @@ public class PsiDirectoryNode extends BasePsiNode<PsiDirectory> implements Navig
myFilter = filter;
}
public PsiDirectoryNode(PsiDirectoryNode original) {
super(original.getProject(), original.getValue(), original.getSettings());
myFilter = original.getFilter();
}
@Nullable
public PsiFileSystemItemFilter getFilter() {
return myFilter;

View File

@@ -1,6 +1,7 @@
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package com.intellij.ide.workspace.projectView
import com.intellij.icons.ExpUiIcons
import com.intellij.ide.projectView.PresentationData
import com.intellij.ide.projectView.TreeStructureProvider
import com.intellij.ide.projectView.ViewSettings
@@ -89,16 +90,25 @@ internal class WorkspaceTreeStructureProvider(val project: Project) : TreeStruct
val subprojects = SubprojectHandler.getAllSubprojects(project).associateBy { it.projectPath }
subprojectMap.clear()
val children = projectNode.children.filter { it !is ExternalLibrariesNode }
val newChildren = ArrayList<AbstractTreeNode<*>>(children.size)
for (child in children) {
val directoryNode = child as? PsiDirectoryNode ?: continue
val directoryNode = child as? PsiDirectoryNode
if (directoryNode == null) {
newChildren.add(child)
continue
}
val path = directoryNode.value.virtualFile.path
subprojectMap[directoryNode.value] = subprojects[path]
val subproject = subprojects[path]
subprojectMap[directoryNode.value] = subproject
val node = if (subproject != null) SubprojectNode(directoryNode, subproject) else directoryNode
newChildren.add(node)
}
return children
return newChildren
}
override fun update(data: PresentationData) {
projectNode.update(data)
data.setIcon(ExpUiIcons.Nodes.Workspace)
}
override fun contains(file: VirtualFile): Boolean {
@@ -107,4 +117,14 @@ internal class WorkspaceTreeStructureProvider(val project: Project) : TreeStruct
fun getSubproject(directory: PsiDirectory) = subprojectMap[directory]
}
private class SubprojectNode(original: PsiDirectoryNode,
private val subproject: Subproject):
PsiDirectoryNode(original) {
override fun update(data: PresentationData) {
super.update(data)
data.setIcon(subproject.handler.subprojectIcon)
}
}
}

View File

@@ -583,6 +583,7 @@ public final class ExpUiIcons {
/** 16x16 */ public static final @NotNull Icon Variable = load("expui/nodes/variable.svg", -1087516698, 2);
/** 16x16 */ public static final @NotNull Icon WarningIntroduction = load("expui/nodes/warningIntroduction.svg", 2093509580, 2);
/** 16x16 */ public static final @NotNull Icon WebFolder = load("expui/nodes/webFolder.svg", 1933155443, 2);
/** 16x16 */ public static final @NotNull Icon Workspace = load("expui/nodes/workspace.svg", 933675081, 2);
}
public static final class ObjectBrowser {

View File

@@ -18,5 +18,6 @@ public final class GradleIcons {
/** 16x16 */ public static final @NotNull Icon GradleFile = load("icons/gradleFile.svg", -392919783, 0);
/** 16x16 */ public static final @NotNull Icon GradleLoadChanges = load("icons/gradleLoadChanges.svg", -927115520, 2);
/** 16x16 */ public static final @NotNull Icon GradleNavigate = load("icons/gradleNavigate.svg", 2045411481, 2);
/** 16x16 */ public static final @NotNull Icon GradleSubproject = load("icons/gradleSubproject.svg", -908281194, 2);
/** 13x13 */ public static final @NotNull Icon ToolWindowGradle = load("icons/toolWindowGradle.svg", 661706798, 2);
}

View File

@@ -196,7 +196,7 @@ public final class GradleTreeStructureProvider implements TreeStructureProvider,
final Module module = fileIndex.getModuleForFile(virtualFile);
final String moduleShortName = getGradleModuleShortName(module);
if (moduleShortName == null) return null;
return new GradleModuleDirectoryNode(project, psiDirectory, settings, module, moduleShortName, directoryNode.getFilter());
return new GradleModuleDirectoryNode(directoryNode, module, moduleShortName);
}
@Nullable
@@ -227,17 +227,16 @@ public final class GradleTreeStructureProvider implements TreeStructureProvider,
private final Module myModule;
private final boolean appendModuleName;
private final boolean isSourceSetModule;
private final PsiDirectoryNode myOriginal;
GradleModuleDirectoryNode(Project project,
@NotNull PsiDirectory psiDirectory,
ViewSettings settings,
GradleModuleDirectoryNode(PsiDirectoryNode original,
Module module,
String moduleShortName,
PsiFileSystemItemFilter filter) {
super(project, psiDirectory, settings, filter);
String moduleShortName) {
super(original);
myOriginal = original;
myModuleShortName = moduleShortName;
myModule = module;
VirtualFile directoryFile = psiDirectory.getVirtualFile();
VirtualFile directoryFile = getValue().getVirtualFile();
appendModuleName = StringUtil.isNotEmpty(myModuleShortName) &&
!StringUtil.equalsIgnoreCase(myModuleShortName.replace("-", ""), directoryFile.getName().replace("-", ""));
isSourceSetModule = isSourceSetModule(myModule);
@@ -249,8 +248,11 @@ public final class GradleTreeStructureProvider implements TreeStructureProvider,
}
@Override
protected void updateImpl(@NotNull PresentationData data) {
public void update(@NotNull PresentationData data) {
super.updateImpl(data);
PresentationData originalPresentation = new PresentationData();
myOriginal.update(originalPresentation);
data.setIcon(originalPresentation.getIcon(false));
if (appendModuleName) {
if (!canRealModuleNameBeHidden()) {
data.addText("[" + myModuleShortName + "]", REGULAR_BOLD_ATTRIBUTES);

View File

@@ -12,11 +12,13 @@ import com.intellij.openapi.project.Project
import com.intellij.openapi.project.guessProjectDir
import com.intellij.openapi.vfs.VirtualFile
import com.intellij.platform.externalSystem.impl.workspace.ExternalSubprojectHandler
import icons.GradleIcons
import org.jetbrains.plugins.gradle.service.project.open.canOpenGradleProject
import org.jetbrains.plugins.gradle.service.project.open.linkAndSyncGradleProject
import org.jetbrains.plugins.gradle.settings.GradleProjectSettings
import org.jetbrains.plugins.gradle.settings.GradleSettings
import org.jetbrains.plugins.gradle.util.GradleConstants
import javax.swing.Icon
internal class GradleSubprojectHandler : ExternalSubprojectHandler(GradleConstants.SYSTEM_ID) {
@@ -29,6 +31,9 @@ internal class GradleSubprojectHandler : ExternalSubprojectHandler(GradleConstan
override fun suppressGenericImportFor(module: Module): Boolean {
return ExternalSystemModulePropertyManager.getInstance(module).getExternalSystemId() == GradleConstants.SYSTEM_ID.id
}
override val subprojectIcon: Icon
get() = GradleIcons.GradleSubproject
}
private class GradleImportedProjectSettings(private val project: Project) : ImportedProjectSettings {

View File

@@ -0,0 +1,6 @@
<!-- Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -->
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M15.565 10.3794C15.3324 10.1419 15.0185 10.0059 14.6895 10.0002C14.3605 9.99443 14.0422 10.1193 13.8018 10.3485C13.7897 10.3602 13.7801 10.3743 13.7736 10.3899C13.767 10.4055 13.7636 10.4223 13.7636 10.4393C13.7636 10.4562 13.767 10.473 13.7736 10.4887C13.7801 10.5043 13.7897 10.5183 13.8018 10.53L13.9547 10.6898C13.9754 10.7107 14.0028 10.7234 14.0319 10.7254C14.0609 10.7274 14.0898 10.7186 14.113 10.7007C14.2597 10.5811 14.4459 10.524 14.6329 10.5414C14.8198 10.5587 14.9929 10.6492 15.116 10.7938C15.2391 10.9385 15.3027 11.1261 15.2934 11.3174C15.2841 11.5088 15.2027 11.6891 15.0662 11.8206C14.6477 12.2474 14.171 11.9997 13.5378 11.6708C12.647 11.2079 11.4465 10.5842 9.66257 11.4521C9.61107 11.4774 9.56524 11.5132 9.52801 11.5575C9.49077 11.6017 9.46292 11.6533 9.4462 11.7091C9.42949 11.7649 9.42428 11.8236 9.43092 11.8815C9.43755 11.9394 9.45587 11.9953 9.48474 12.0457L10.0085 12.9687C10.0373 13.0199 10.0761 13.0638 10.1218 13.0981C10.1325 13.1059 10.1437 13.1131 10.1551 13.1198C10.2177 13.1565 10.2883 13.1754 10.3598 13.1752L10.3613 13.1752C10.4297 13.1753 10.4972 13.1575 10.5574 13.123L10.5609 13.121C10.9107 12.9279 11.231 12.7004 11.5244 12.4307C11.6261 12.3372 11.7842 12.3439 11.8777 12.4455C11.9711 12.5471 11.9645 12.7053 11.8628 12.7987C11.539 13.0965 11.1863 13.3468 10.8042 13.5578C10.669 13.6348 10.5164 13.6754 10.3609 13.6752C10.1998 13.6756 10.0417 13.6328 9.90255 13.5513C9.76323 13.4698 9.64805 13.3526 9.56811 13.2121L9.09541 12.3796C8.27149 13.1021 7.7946 14.3497 8.08603 15.8992C8.0912 15.9274 8.10583 15.9529 8.12742 15.9713C8.149 15.9897 8.17619 15.9998 8.2043 16H8.76271C8.79347 16.0008 8.82338 15.9896 8.84635 15.9687C8.86931 15.9478 8.8836 15.9187 8.88631 15.8874C8.91254 15.6847 9.01007 15.4986 9.16073 15.3638C9.31138 15.229 9.5049 15.1547 9.70525 15.1547C9.9056 15.1547 10.0991 15.229 10.2498 15.3638C10.4004 15.4986 10.498 15.6847 10.5242 15.8874C10.5277 15.9172 10.5417 15.9446 10.5637 15.9645C10.5856 15.9844 10.614 15.9954 10.6433 15.9954H11.1893C11.2186 15.9952 11.2469 15.9841 11.2688 15.9643C11.2907 15.9444 11.3048 15.9171 11.3085 15.8874C11.3347 15.6847 11.4322 15.4986 11.5829 15.3638C11.7336 15.229 11.9271 15.1547 12.1274 15.1547C12.3278 15.1547 12.5213 15.229 12.6719 15.3638C12.8226 15.4986 12.9201 15.6847 12.9464 15.8874C12.95 15.9171 12.9641 15.9444 12.986 15.9643C13.008 15.9841 13.0362 15.9952 13.0655 15.9954H13.6079C13.6397 15.9954 13.6702 15.9827 13.6928 15.9599C13.7154 15.9372 13.7284 15.9062 13.7288 15.8738C13.7413 15.0933 13.9476 14.1966 14.5354 13.7474C16.5716 12.1927 16.0363 10.8604 15.565 10.3794ZM12.6279 12.7721L13.4922 13.2142C13.5665 13.158 13.6256 13.0853 13.6637 12.9993C13.7018 12.9132 13.7176 12.8186 13.7097 12.7245C13.7018 12.6304 13.6705 12.5399 13.6186 12.4617C13.5667 12.3835 13.4961 12.3201 13.4135 12.2776C13.3308 12.2352 13.2389 12.215 13.1464 12.2191C13.054 12.2232 12.9641 12.2513 12.8853 12.3009C12.8066 12.3505 12.7416 12.4198 12.6965 12.5023C12.6515 12.5848 12.6278 12.6777 12.6279 12.7721Z" fill="#4682FA"/>
<path d="M1 3.86667C1 2.83574 1.73127 2 2.63333 2H6.1217C6.39413 2 6.65477 2.11115 6.84336 2.30775L8.46667 4L13 4C14.1046 4 15 4.89543 15 6V9.00019H14.6975C14.1063 8.99248 13.5387 9.21829 13.1124 9.62462L13.1072 9.62955L13.1055 9.63119C12.9964 9.73724 12.9105 9.86373 12.8522 10.0024C12.8195 10.0802 12.7957 10.1612 12.7812 10.2439C12.5697 10.1751 12.3421 10.1162 12.0993 10.0759C11.2547 9.93571 10.2982 10.031 9.22485 10.5533L9.22277 10.5543C9.04568 10.6411 8.88945 10.7639 8.76346 10.9135C8.63751 11.0631 8.54439 11.2366 8.48877 11.4221C8.46921 11.4874 8.4544 11.5539 8.44437 11.621L8.4366 11.6278C7.76612 12.2157 7.29304 13.0363 7.0988 14H2.63333C1.73127 14 1 13.1643 1 12.1333V3.86667Z" fill="#EBECF0"/>
<path d="M6.1217 3L2.63333 3C2.40481 3 2 3.25841 2 3.86667V12.1333C2 12.7416 2.40481 13 2.63333 13H7.42186C7.27921 13.311 7.17018 13.6459 7.0988 14H2.63333C1.73127 14 1 13.1643 1 12.1333V3.86667C1 2.83574 1.73127 2 2.63333 2H6.1217C6.39413 2 6.65477 2.11115 6.84336 2.30775L8.46667 4L13 4C14.1046 4 15 4.89543 15 6V9.00019H14.6975C14.4586 8.99708 14.2235 9.03211 14 9.10179V6C14 5.44771 13.5523 5 13 5H8.04022L6.1217 3Z" fill="#6C707E"/>
</svg>

After

Width:  |  Height:  |  Size: 4.3 KiB

View File

@@ -0,0 +1,6 @@
<!-- Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -->
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M15.565 10.3794C15.3324 10.1419 15.0185 10.0059 14.6895 10.0002C14.3605 9.99443 14.0422 10.1193 13.8018 10.3485C13.7897 10.3602 13.7801 10.3743 13.7736 10.3899C13.767 10.4055 13.7636 10.4223 13.7636 10.4393C13.7636 10.4562 13.767 10.473 13.7736 10.4887C13.7801 10.5043 13.7897 10.5183 13.8018 10.53L13.9547 10.6898C13.9754 10.7107 14.0028 10.7234 14.0319 10.7254C14.0609 10.7274 14.0898 10.7186 14.113 10.7007C14.2597 10.5811 14.4459 10.524 14.6329 10.5414C14.8198 10.5587 14.9929 10.6492 15.116 10.7938C15.2391 10.9385 15.3027 11.1261 15.2934 11.3174C15.2841 11.5088 15.2027 11.6891 15.0662 11.8206C14.6477 12.2474 14.171 11.9997 13.5378 11.6708C12.647 11.2079 11.4465 10.5842 9.66257 11.4521C9.61107 11.4774 9.56524 11.5132 9.52801 11.5575C9.49077 11.6017 9.46292 11.6533 9.4462 11.7091C9.42949 11.7649 9.42428 11.8236 9.43092 11.8815C9.43755 11.9394 9.45587 11.9953 9.48474 12.0457L10.0085 12.9687C10.0373 13.0199 10.0761 13.0638 10.1218 13.0981C10.1325 13.1059 10.1437 13.1131 10.1551 13.1198C10.2177 13.1565 10.2883 13.1754 10.3598 13.1752L10.3613 13.1752C10.4297 13.1753 10.4972 13.1575 10.5574 13.123L10.5609 13.121C10.9107 12.9279 11.231 12.7004 11.5244 12.4307C11.6261 12.3372 11.7842 12.3439 11.8777 12.4455C11.9711 12.5471 11.9645 12.7053 11.8628 12.7987C11.539 13.0965 11.1863 13.3468 10.8042 13.5578C10.669 13.6348 10.5164 13.6754 10.3609 13.6752C10.1998 13.6756 10.0417 13.6328 9.90255 13.5513C9.76323 13.4698 9.64805 13.3526 9.56811 13.2121L9.09541 12.3796C8.27149 13.1021 7.7946 14.3497 8.08603 15.8992C8.0912 15.9274 8.10583 15.9529 8.12742 15.9713C8.149 15.9897 8.17619 15.9998 8.2043 16H8.76271C8.79347 16.0008 8.82338 15.9896 8.84635 15.9687C8.86931 15.9478 8.8836 15.9187 8.88631 15.8874C8.91254 15.6847 9.01007 15.4986 9.16073 15.3638C9.31138 15.229 9.5049 15.1547 9.70525 15.1547C9.9056 15.1547 10.0991 15.229 10.2498 15.3638C10.4004 15.4986 10.498 15.6847 10.5242 15.8874C10.5277 15.9172 10.5417 15.9446 10.5637 15.9645C10.5856 15.9844 10.614 15.9954 10.6433 15.9954H11.1893C11.2186 15.9952 11.2469 15.9841 11.2688 15.9643C11.2907 15.9444 11.3048 15.9171 11.3085 15.8874C11.3347 15.6847 11.4322 15.4986 11.5829 15.3638C11.7336 15.229 11.9271 15.1547 12.1274 15.1547C12.3278 15.1547 12.5213 15.229 12.6719 15.3638C12.8226 15.4986 12.9201 15.6847 12.9464 15.8874C12.95 15.9171 12.9641 15.9444 12.986 15.9643C13.008 15.9841 13.0362 15.9952 13.0655 15.9954H13.6079C13.6397 15.9954 13.6702 15.9827 13.6928 15.9599C13.7154 15.9372 13.7284 15.9062 13.7288 15.8738C13.7413 15.0933 13.9476 14.1966 14.5354 13.7474C16.5716 12.1927 16.0363 10.8604 15.565 10.3794ZM12.6279 12.7721L13.4922 13.2142C13.5665 13.158 13.6256 13.0853 13.6637 12.9993C13.7018 12.9132 13.7176 12.8186 13.7097 12.7245C13.7018 12.6304 13.6705 12.5399 13.6186 12.4617C13.5667 12.3835 13.4961 12.3201 13.4135 12.2776C13.3308 12.2352 13.2389 12.215 13.1464 12.2191C13.054 12.2232 12.9641 12.2513 12.8853 12.3009C12.8066 12.3505 12.7416 12.4198 12.6965 12.5023C12.6515 12.5848 12.6278 12.6777 12.6279 12.7721Z" fill="#548AF7"/>
<path d="M1 3.86667C1 2.83574 1.73127 2 2.63333 2H6.1217C6.39413 2 6.65477 2.11115 6.84336 2.30775L8.46667 4L13 4C14.1046 4 15 4.89543 15 6V9.00019H14.6975C14.1063 8.99248 13.5387 9.21829 13.1124 9.62462L13.1072 9.62955L13.1055 9.63119C12.9964 9.73724 12.9105 9.86373 12.8522 10.0024C12.8195 10.0802 12.7957 10.1612 12.7812 10.2439C12.5697 10.1751 12.3421 10.1162 12.0993 10.0759C11.2547 9.93571 10.2982 10.031 9.22485 10.5533L9.22277 10.5543C9.04568 10.6411 8.88945 10.7639 8.76346 10.9135C8.63751 11.0631 8.54439 11.2366 8.48877 11.4221C8.46921 11.4874 8.4544 11.5539 8.44437 11.621L8.4366 11.6278C7.76612 12.2157 7.29304 13.0363 7.0988 14H2.63333C1.73127 14 1 13.1643 1 12.1333V3.86667Z" fill="#43454A"/>
<path d="M6.1217 3L2.63333 3C2.40481 3 2 3.25841 2 3.86667V12.1333C2 12.7416 2.40481 13 2.63333 13H7.42186C7.27921 13.311 7.17018 13.6459 7.0988 14H2.63333C1.73127 14 1 13.1643 1 12.1333V3.86667C1 2.83574 1.73127 2 2.63333 2H6.1217C6.39413 2 6.65477 2.11115 6.84336 2.30775L8.46667 4L13 4C14.1046 4 15 4.89543 15 6V9.00019H14.6975C14.4586 8.99708 14.2235 9.03211 14 9.10179V6C14 5.44771 13.5523 5 13 5H8.04022L6.1217 3Z" fill="#CED0D6"/>
</svg>

After

Width:  |  Height:  |  Size: 4.3 KiB

View File

@@ -18,6 +18,7 @@ public final class MavenIcons {
/** 16x16 */ public static final @NotNull Icon ExecuteMavenGoal = load("images/executeMavenGoal.svg", 1709385426, 2);
/** 16x16 */ public static final @NotNull Icon MavenIgnored = load("images/mavenIgnored.svg", -1578112873, 2);
/** 16x16 */ public static final @NotNull Icon MavenLoadChanges = load("images/mavenLoadChanges.svg", 15449020, 2);
/** 16x16 */ public static final @NotNull Icon MavenModule = load("images/mavenModule.svg", -1526380836, 2);
/** 16x16 */ public static final @NotNull Icon MavenPlugin = load("images/mavenPlugin.svg", 660249577, 0);
/** 16x16 */ public static final @NotNull Icon MavenProject = load("images/mavenProject.svg", -1399986903, 0);
/** 16x16 */ public static final @NotNull Icon MavenRepoFolder = load("images/mavenRepoFolder.svg", 205206251, 0);

View File

@@ -8,10 +8,12 @@ import com.intellij.openapi.module.Module
import com.intellij.openapi.project.Project
import com.intellij.openapi.project.guessProjectDir
import com.intellij.openapi.vfs.VirtualFile
import icons.MavenIcons
import org.jetbrains.idea.maven.project.MavenProject
import org.jetbrains.idea.maven.project.MavenProjectsManager
import org.jetbrains.idea.maven.utils.MavenUtil
import org.jetbrains.idea.maven.wizards.MavenOpenProjectProvider
import javax.swing.Icon
internal class MavenSubprojectHandler : SubprojectHandler {
override fun getSubprojects(project: Project): List<Subproject> {
@@ -37,6 +39,9 @@ internal class MavenSubprojectHandler : SubprojectHandler {
override fun suppressGenericImportFor(module: Module): Boolean {
return MavenProjectsManager.getInstance(module.project).findProject(module) != null
}
override val subprojectIcon: Icon
get() = MavenIcons.MavenModule
}
private class MavenImportedProjectSettings(project: Project) : ImportedProjectSettings {

View File

@@ -0,0 +1,6 @@
<!-- Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -->
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M1 3.86667C1 2.83574 1.7835 2 2.75 2H6.03823C6.29871 2 6.5489 2.10163 6.73559 2.28327L8.5 4L13 4C14.1046 4 15 4.89543 15 6V10.0077C14.9326 10.0029 14.8646 10.0006 14.7962 10.0006C14.0685 10.0006 13.5053 10.1786 13.0168 10.4533C12.6398 10.1562 12.1774 10.017 11.6842 10.004C11.1124 9.97558 10.5976 10.0998 10.1448 10.3018C10.0082 10.22 9.84957 10.1573 9.66781 10.1205C8.92376 9.9697 8.12534 10.4138 7.94429 11.2213L7.9439 11.2231L7.31645 14H2.75C1.7835 14 1 13.1643 1 12.1333V3.86667Z" fill="#EBECF0"/>
<path d="M8.09379 5L6.03823 3H2.75C2.3956 3 2 3.32624 2 3.86667V12.1333C2 12.6738 2.3956 13 2.75 13H7.5424L7.31645 14H2.75C1.7835 14 1 13.1643 1 12.1333V3.86667C1 2.83574 1.7835 2 2.75 2H6.03823C6.29871 2 6.5489 2.10163 6.73559 2.28327L8.5 4L13 4C14.1046 4 15 4.89543 15 6V10.0077C14.9326 10.0029 14.8646 10.0006 14.7962 10.0006C14.5066 10.0006 14.2431 10.0288 14 10.08V6C14 5.44772 13.5523 5 13 5H8.09379Z" fill="#6C707E"/>
<path d="M14.7961 11.0006C15.9327 11.0006 16.1301 11.958 15.9327 12.8207L15.299 15.6443C15.2464 15.883 15.0009 16.0358 14.7506 15.9856C14.5003 15.9354 14.3401 15.7013 14.3927 15.4626L14.9842 12.8207C15.2988 11.4527 13.5154 11.6214 12.7918 12.6372L12.1095 15.6468C12.0569 15.8854 11.8114 16.0382 11.5611 15.988C11.5508 15.986 11.5407 15.9836 11.5307 15.9809C11.2925 15.9223 11.1426 15.6946 11.1937 15.4626L11.7879 12.8185C11.932 12.2008 11.636 11.8971 11.2061 11.8438C10.6944 11.7889 9.99349 12.0905 9.60233 12.6396L8.91613 15.6502C8.86295 15.8887 8.61705 16.041 8.36689 15.9903C8.11673 15.9396 7.95704 15.7051 8.01021 15.4666L8.91987 11.4406C8.97305 11.2021 9.21895 11.0498 9.46911 11.1005C9.75344 11.1582 9.87045 11.4192 9.81566 11.6696C10.3391 11.2567 10.9491 10.965 11.6464 11.0034C12.3271 11.0171 12.6598 11.3833 12.7687 11.8623C13.3963 11.3251 13.9265 11.0006 14.7961 11.0006Z" fill="#3574F0"/>
</svg>

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

@@ -0,0 +1,13 @@
<!-- Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -->
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_2323_32173)">
<path d="M1 3.86667C1 2.83574 1.7835 2 2.75 2H6.03823C6.29871 2 6.5489 2.10163 6.73559 2.28327L8.5 4L13 4C14.1046 4 15 4.89543 15 6V10.0077C14.9326 10.0029 14.8646 10.0006 14.7962 10.0006C14.0685 10.0006 13.5053 10.1786 13.0168 10.4533C12.6398 10.1562 12.1774 10.017 11.6842 10.004C11.1124 9.97558 10.5976 10.0998 10.1448 10.3018C10.0082 10.22 9.84957 10.1573 9.66781 10.1205C8.92376 9.9697 8.12534 10.4138 7.94429 11.2213L7.9439 11.2231L7.31645 14H2.75C1.7835 14 1 13.1643 1 12.1333V3.86667Z" fill="#43454A"/>
<path d="M8.09379 5L6.03823 3H2.75C2.3956 3 2 3.32624 2 3.86667V12.1333C2 12.6738 2.3956 13 2.75 13H7.5424L7.31645 14H2.75C1.7835 14 1 13.1643 1 12.1333V3.86667C1 2.83574 1.7835 2 2.75 2H6.03823C6.29871 2 6.5489 2.10163 6.73559 2.28327L8.5 4L13 4C14.1046 4 15 4.89543 15 6V10.0077C14.9326 10.0029 14.8646 10.0006 14.7962 10.0006C14.5066 10.0006 14.2431 10.0288 14 10.08V6C14 5.44772 13.5523 5 13 5H8.09379Z" fill="#CED0D6"/>
<path d="M14.7961 11.0006C15.9327 11.0006 16.1301 11.958 15.9327 12.8207L15.299 15.6443C15.2464 15.883 15.0009 16.0358 14.7506 15.9856C14.5003 15.9354 14.3401 15.7013 14.3927 15.4626L14.9842 12.8207C15.2988 11.4527 13.5154 11.6214 12.7918 12.6372L12.1095 15.6468C12.0569 15.8854 11.8114 16.0382 11.5611 15.988C11.5508 15.986 11.5407 15.9836 11.5307 15.9809C11.2925 15.9223 11.1426 15.6946 11.1937 15.4626L11.7879 12.8185C11.932 12.2008 11.636 11.8971 11.2061 11.8438C10.6944 11.7889 9.99349 12.0905 9.60233 12.6396L8.91613 15.6502C8.86295 15.8887 8.61705 16.041 8.36689 15.9903C8.11673 15.9396 7.95704 15.7051 8.01021 15.4666L8.91987 11.4406C8.97305 11.2021 9.21895 11.0498 9.46911 11.1005C9.75344 11.1582 9.87045 11.4192 9.81566 11.6696C10.3391 11.2567 10.9491 10.965 11.6464 11.0034C12.3271 11.0171 12.6598 11.3833 12.7687 11.8623C13.3963 11.3251 13.9265 11.0006 14.7961 11.0006Z" fill="#548AF7"/>
</g>
<defs>
<clipPath id="clip0_2323_32173">
<rect width="16" height="16" fill="white"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 2.2 KiB