static String updatePresentation(@Nullable Object p, @NotNull ParameterInfoUIContext context) { if (p == null) { context.setUIComponentEnabled(false); return null; ? Math.min(context.getCurrentParameterIndex(), parametersPresentations.size() - 1) : context.getCurrentParameterIndex(); builder.append(CodeInsightBundle.message("parameter.info.no.parameters")); return context.setupUIComponentPresentation(builder.toString(), start, end, false, false, false, context.getDefaultParameterColor());
public void setUpUIPresentation(@NotNull ParameterInfoUIContext context) { String text = toString(); context.setupUIComponentPresentation( text, myIsSelected ? 0 : -1, myIsSelected ? text.length() : 0, false, false, false, context.getDefaultParameterColor() ); }
public String getPresentation(CypherInvocation ci, @NotNull ParameterInfoUIContext context) { if (ci == null) { context.setUIComponentEnabled(false); return null; } String signature = ci.resolve().stream() .findFirst() .map(InvokableInformation::getSignature) .orElse(null); int current = context.getCurrentParameterIndex(); int start = 0; int end = 0; if (signature == null) { String message = "unknown parameters"; return context.setupUIComponentPresentation(message, start, end, false, false, false, JBColor.RED); } if (Objects.equals(signature, "()")) { String message = "no parameters"; return context.setupUIComponentPresentation(message, start, end, false, false, false, JBColor.RED); } String stripped = signature.substring(1, signature.length() - 1) + ","; int from = StringUtils.ordinalIndexOf(stripped, ",", current) + 2; int to = StringUtils.ordinalIndexOf(stripped, ",", current + 1) + 1; return context.setupUIComponentPresentation( signature, from, to, false, false, false, context.getDefaultParameterColor()); }
@Override public void updateUI(Object p, @NotNull ParameterInfoUIContext context) { if (p == null) { context.setUIComponentEnabled(false); return; int currentParameterIndex = context.getCurrentParameterIndex(); boolean grayedOut = currentParameterIndex != -1 && !componentNameList.isEmpty() && componentNameList.size() <= currentParameterIndex; context.setUIComponentEnabled(!grayedOut); context.setupUIComponentPresentation( message, parameterRange.getStartOffset(), parameterRange.getEndOffset(), !context.isUIComponentEnabled(), false, //TODO: set deprecated from doccomment? false, context.getDefaultParameterColor() );