Java Code Examples for com.intellij.lang.parameterInfo.ParameterInfoUIContext#setupUIComponentPresentation()

The following examples show how to use com.intellij.lang.parameterInfo.ParameterInfoUIContext#setupUIComponentPresentation() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ORParameterInfoHandlerWithTabActionSupport.java    From reasonml-idea-plugin with MIT License 6 votes vote down vote up
@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());
}
 
Example 2
Source File: CSharpParameterInfoHandler.java    From consulo-csharp with Apache License 2.0 6 votes vote down vote up
@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());
}
 
Example 3
Source File: CSharpGenericParameterInfoHandler.java    From consulo-csharp with Apache License 2.0 6 votes vote down vote up
@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());
}
 
Example 4
Source File: XQueryParameterInfoHandler.java    From intellij-xquery with Apache License 2.0 6 votes vote down vote up
@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());
}