CWM-4049 merged settings: show gray "On Host" label instead of "(Remote)" for provided from Host configurables

GitOrigin-RevId: 6bf5c6c87c7ffa908421abdaef491a19af0af161
This commit is contained in:
Vladimir.Petrenko
2021-11-19 11:35:28 +00:00
committed by intellij-monorepo-bot
parent d81675d578
commit bdb8b64efd
2 changed files with 21 additions and 0 deletions
@@ -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 org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.Nls;
import org.jetbrains.annotations.Nullable;
@ApiStatus.Internal
@ApiStatus.Experimental
public interface ConfigurableLabelProvider {
@Nls @Nullable String getLabel();
}
@@ -653,6 +653,14 @@ public class SettingsTreeView extends JComponent implements Accessible, Disposab
null;
myNodeIcon.setIcon(nodeIcon);
if (configurable instanceof ConfigurableLabelProvider) {
String label = ((ConfigurableLabelProvider)configurable).getLabel();
if (label != null) {
myTextLabel.append(" ", SimpleTextAttributes.REGULAR_ATTRIBUTES, false);
myTextLabel.append(label, SimpleTextAttributes.GRAYED_SMALL_ATTRIBUTES, false);
}
}
if (node != null && UISettings.getInstance().getShowInplaceCommentsInternal()) {
ConfigurableWrapper wrapper = configurable instanceof ConfigurableWrapper ?
((ConfigurableWrapper)configurable) :