use of com.intellij.openapi.options.colors.AttributesDescriptor in project intellij-community by JetBrains.
the class ColorAndFontDescriptionPanel method setInheritanceInfo.
private void setInheritanceInfo(ColorAndFontDescription description) {
Pair<ColorSettingsPage, AttributesDescriptor> baseDescriptor = description.getBaseAttributeDescriptor();
if (baseDescriptor != null && baseDescriptor.second.getDisplayName() != null) {
String attrName = baseDescriptor.second.getDisplayName();
String attrLabel = attrName.replaceAll(EditorSchemeAttributeDescriptorWithPath.NAME_SEPARATOR, FontUtil.rightArrow(UIUtil.getLabelFont()));
ColorSettingsPage settingsPage = baseDescriptor.first;
String style = "<div style=\"text-align:right\" vertical-align=\"top\">";
String tooltipText;
String labelText;
if (settingsPage != null) {
String pageName = settingsPage.getDisplayName();
tooltipText = "'" + attrLabel + "' from<br>'" + pageName + "' section";
labelText = style + "'" + attrLabel + "'<br>of <a href=\"" + attrName + "\">" + pageName;
} else {
tooltipText = attrLabel;
labelText = style + attrLabel + "<br> ";
}
myInheritanceLabel.setVisible(true);
myInheritanceLabel.setText(labelText);
myInheritanceLabel.setToolTipText(tooltipText);
myInheritanceLabel.setEnabled(true);
myInheritAttributesBox.setVisible(true);
myInheritAttributesBox.setEnabled(description.isEditable());
myInheritAttributesBox.setSelected(description.isInherited());
setEditEnabled(!description.isInherited() && description.isEditable(), description);
} else {
myInheritanceLabel.setVisible(false);
myInheritAttributesBox.setSelected(false);
myInheritAttributesBox.setVisible(false);
setEditEnabled(description.isEditable(), description);
}
}
Aggregations