final int paramPos = Math.max(0, Math.min(selectedFunction.getParameterCount() - 1, parameterPosition));
final String displayName = selectedFunction.getParameterDisplayName(paramPos, Locale.getDefault());
final String description = selectedFunction.getParameterDescription(paramPos, Locale.getDefault());
final JLabel paramNameLabel = new JLabel(displayName);
final InlineEditTextField paramTextField = new InlineEditTextField();
paramTextField.setText(parameterValue);
if (parameterValue != null)
{
paramTextField.setCaretPosition(parameterValue.length());
}
paramTextField.setFont
(new Font(Font.MONOSPACED, paramTextField.getFont().getStyle(), paramTextField.getFont().getSize()));
final FocusListenerHandler handler = new FocusListenerHandler(paramTextField, parameterPosition);
paramTextField.addFocusListener(handler);
if (requestFocus)
{
paramTextField.setFocusable(true);
paramTextField.requestFocusInWindow();
}
final SelectFieldAction selectFieldAction =
new SelectFieldAction(this, new FieldSelectorUpdateHandler(parameterPosition), this);
// treat insert field as parameter edit