Java源码示例:com.intellij.lang.parameterInfo.ParameterInfoUIContext
示例1
@Override
public void updateUI(@Nullable ORSignature signature, @NotNull ParameterInfoUIContext context) {
if (signature == null) {
context.setUIComponentEnabled(false);
return;
}
int currentParameterIndex = context.getCurrentParameterIndex();
ORSignature.SignatureType[] types = signature.getTypes();
boolean grayedOut = types.length <= currentParameterIndex;
context.setUIComponentEnabled(!grayedOut);
TextRange paramRange = TextRange.EMPTY_RANGE;
context.setupUIComponentPresentation(signature.asParameterInfo(OclLanguage.INSTANCE), paramRange.getStartOffset(), paramRange.getEndOffset(),
!context.isUIComponentEnabled(), false, true, context.getDefaultParameterColor());
}
示例2
@Override
@RequiredUIAccess
public void updateUI(ItemToShow p, ParameterInfoUIContext context)
{
if(p == null)
{
context.setUIComponentEnabled(false);
return;
}
ParameterPresentationBuilder<CSharpSimpleParameterInfo> build = CSharpParametersInfo.build(p.myLikeMethod, p.myScope);
String text = build.toString();
TextRange parameterRange = build.getParameterRange(context.getCurrentParameterIndex());
context.setupUIComponentPresentation(text, parameterRange.getStartOffset(), parameterRange.getEndOffset(), !context.isUIComponentEnabled(), p.isObsolete(), false, context
.getDefaultParameterColor());
}
示例3
@Override
public void updateUI(DotNetGenericParameterListOwner p, ParameterInfoUIContext context)
{
if(p == null)
{
context.setUIComponentEnabled(false);
return;
}
CSharpGenericParametersInfo build = CSharpGenericParametersInfo.build(p);
if(build == null)
{
context.setUIComponentEnabled(false);
return;
}
String text = build.getText();
TextRange parameterRange = build.getParameterRange(context.getCurrentParameterIndex());
context.setupUIComponentPresentation(text, parameterRange.getStartOffset(), parameterRange.getEndOffset(), !context.isUIComponentEnabled(),
false, false, context.getDefaultParameterColor());
}
示例4
@Override
public void updateUI(Object p, ParameterInfoUIContext context) {
if (p == null) {
context.setUIComponentEnabled(false);
return;
}
int index = context.getCurrentParameterIndex();
ParameterPresentation presentation = null;
if (p instanceof XQueryFunctionDecl) {
presentation = buildUserFunctionPresentation((XQueryFunctionDecl) p, index);
} else if (p instanceof BuiltInFunctionSignature) {
presentation = buildBuiltInFunctionPresentation((BuiltInFunctionSignature) p, index);
}
context.setupUIComponentPresentation(presentation.text, presentation.start, presentation.end,
presentation.disabled, false, true,
context.getDefaultParameterColor());
}