use of com.intellij.ui.ColorLineMarkerProvider in project intellij-plugins by JetBrains.
the class FlexMxmlColorAnnotator method annotate.
@Override
public void annotate(@NotNull PsiElement element, @NotNull AnnotationHolder holder) {
if (!(element instanceof XmlAttribute) || !JavaScriptSupportLoader.isFlexMxmFile(element.getContainingFile())) {
return;
}
if (!LineMarkerSettings.getSettings().isEnabled(new ColorLineMarkerProvider())) {
return;
}
XmlAttribute attribute = (XmlAttribute) element;
XmlAttributeDescriptor descriptor = attribute.getDescriptor();
if (!(descriptor instanceof AnnotationBackedDescriptorImpl)) {
return;
}
AnnotationBackedDescriptorImpl annotationBackedDescriptor = (AnnotationBackedDescriptorImpl) descriptor;
String format = annotationBackedDescriptor.getFormat();
if (!FlexCssPropertyDescriptor.COLOR_FORMAT.equals(format)) {
return;
}
final String value = attribute.getValue();
if (value == null || value.length() == 0) {
return;
}
if (!JSCommonTypeNames.ARRAY_CLASS_NAME.equals(annotationBackedDescriptor.getType())) {
XmlAttributeValue valueElement = attribute.getValueElement();
if (valueElement != null) {
Annotation annotation = holder.createInfoAnnotation(valueElement, null);
annotation.setGutterIconRenderer(new MyRenderer(value, attribute));
}
}
}
Aggregations