From e18995781e610f7fb4d94ec8dd4e4e1571d6dfe5 Mon Sep 17 00:00:00 2001 From: "Maxim.Mossienko" Date: Tue, 17 Nov 2009 18:07:47 +0300 Subject: [PATCH] parameter info for annotation attributes in actionscript --- .../api/impls/XmlParameterInfoHandler.java | 23 +++++++++++++------ 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/xml/impl/src/com/intellij/codeInsight/hint/api/impls/XmlParameterInfoHandler.java b/xml/impl/src/com/intellij/codeInsight/hint/api/impls/XmlParameterInfoHandler.java index f5cb164cc0c6..d7eb845a5789 100644 --- a/xml/impl/src/com/intellij/codeInsight/hint/api/impls/XmlParameterInfoHandler.java +++ b/xml/impl/src/com/intellij/codeInsight/hint/api/impls/XmlParameterInfoHandler.java @@ -26,6 +26,7 @@ import com.intellij.psi.xml.XmlFile; import com.intellij.psi.xml.XmlTag; import com.intellij.psi.xml.XmlToken; import com.intellij.psi.xml.XmlTokenType; +import com.intellij.util.Function; import com.intellij.xml.XmlAttributeDescriptor; import com.intellij.xml.XmlElementDescriptor; import com.intellij.lang.parameterInfo.*; @@ -60,7 +61,7 @@ public class XmlParameterInfoHandler implements ParameterInfoHandler() { + final XmlTag parameterOwner = (XmlTag)context.getParameterOwner(); + + public Boolean fun(String s) { + return parameterOwner != null ? parameterOwner.getAttributeValue(s) != null:false; + } + }); } - private static void updateElementDescriptor(XmlElementDescriptor descriptor, ParameterInfoUIContext context) { + public static void updateElementDescriptor(XmlElementDescriptor descriptor, ParameterInfoUIContext context, + Function attributePresentFun) { final XmlAttributeDescriptor[] attributes = descriptor != null ? getSortedDescriptors(descriptor) : XmlAttributeDescriptor.EMPTY; StringBuffer buffer = new StringBuffer(); @@ -167,10 +178,8 @@ public class XmlParameterInfoHandler implements ParameterInfoHandler