mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
GTW-242 merged settings: provide project configurable icon
GitOrigin-RevId: 54db45eedee6bcc94d4fd8a51fc002f4097f1a10
This commit is contained in:
committed by
intellij-monorepo-bot
parent
b81825f1ab
commit
d81675d578
+13
@@ -0,0 +1,13 @@
|
||||
// Copyright 2000-2021 JetBrains s.r.o. and contributors. 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.options.newEditor;
|
||||
|
||||
import com.intellij.openapi.project.Project;
|
||||
import org.jetbrains.annotations.ApiStatus;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@ApiStatus.Internal
|
||||
@ApiStatus.Experimental
|
||||
public interface ConfigurableProjectProvider {
|
||||
|
||||
@Nullable Project getProject();
|
||||
}
|
||||
+7
-2
@@ -36,6 +36,7 @@ import com.intellij.util.ui.tree.TreeUtil;
|
||||
import com.intellij.util.ui.tree.WideSelectionTreeUI;
|
||||
import com.intellij.util.ui.update.MergingUpdateQueue;
|
||||
import com.intellij.util.ui.update.Update;
|
||||
import org.jetbrains.annotations.ApiStatus;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
@@ -320,8 +321,9 @@ public class SettingsTreeView extends JComponent implements Accessible, Disposab
|
||||
: null;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private static Project prepareProject(CachingSimpleNode parent, Configurable configurable) {
|
||||
@ApiStatus.Internal
|
||||
public static @Nullable Project prepareProject(@Nullable CachingSimpleNode parent,
|
||||
@Nullable Configurable configurable) {
|
||||
if (configurable instanceof ConfigurableWrapper) {
|
||||
ConfigurableWrapper wrapper = (ConfigurableWrapper)configurable;
|
||||
return wrapper.getExtensionPoint().getProject();
|
||||
@@ -341,6 +343,9 @@ public class SettingsTreeView extends JComponent implements Accessible, Disposab
|
||||
return project;
|
||||
}
|
||||
}
|
||||
if (configurable instanceof ConfigurableProjectProvider) {
|
||||
return ((ConfigurableProjectProvider)configurable).getProject();
|
||||
}
|
||||
return parent == null ? null : parent.getProject();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user