Java 类com.intellij.util.ui.table.JBListTable 实例源码

项目:intellij-ce-playground    文件:PyChangeSignatureDialog.java   
@Override
protected JComponent getRowPresentation(ParameterTableModelItemBase<PyParameterInfo> item, boolean selected, final boolean focused) {
  String text = item.parameter.getName();
  final String defaultCallValue = item.defaultValueCodeFragment.getText();
  PyParameterTableModelItem pyItem = (PyParameterTableModelItem)item;
  final String defaultValue = pyItem.isDefaultInSignature()? pyItem.defaultValueCodeFragment.getText() : "";

  if (StringUtil.isNotEmpty(defaultValue)) {
    text += " = " + defaultValue;
  }

  String tail = "";
  if (StringUtil.isNotEmpty(defaultCallValue)) {
    tail += " default value = " + defaultCallValue;
  }
  if (!StringUtil.isEmpty(tail)) {
    text += " //" + tail;
  }
  return JBListTable.createEditorTextFieldPresentation(getProject(), getFileType(), " " + text, selected, focused);
}
项目:tools-idea    文件:JavaChangeSignatureDialog.java   
@Override
protected JComponent getRowPresentation(ParameterTableModelItemBase<ParameterInfoImpl> item, boolean selected, final boolean focused) {
  final String typeText = item.typeCodeFragment.getText();
  final String separator = StringUtil.repeatSymbol(' ', getTypesMaxLength() - typeText.length() + 1);
  String text = typeText + separator + item.parameter.getName();
  final String defaultValue = item.defaultValueCodeFragment.getText();
  String tail = "";
  if (StringUtil.isNotEmpty(defaultValue)) {
    tail += " default value = " + defaultValue;
  }
  if (item.parameter.isUseAnySingleVariable()) {
    if (StringUtil.isNotEmpty(defaultValue)) {
      tail += ";";
    }
    tail += " Use any var.";
  }
  if (!StringUtil.isEmpty(tail)) {
    text += " //" + tail;
  }
  return JBListTable.createEditorTextFieldPresentation(getProject(), getFileType(), " " + text, selected, focused);
}
项目:consulo-csharp    文件:CSharpChangeSignatureDialog.java   
@Override
@RequiredDispatchThread
protected JComponent getRowPresentation(ParameterTableModelItemBase<CSharpParameterInfo> item, boolean selected, final boolean focused)
{
    final String typeText = item.typeCodeFragment.getText();
    CSharpModifier modifier = item.parameter.getModifier();
    String text = "";
    if(modifier != null)
    {
        text = modifier.getPresentableText() + " ";
    }
    final String separator = StringUtil.repeatSymbol(' ', getTypesMaxLength() - typeText.length() + 1);

    text += typeText + separator + item.parameter.getName();
    final String defaultValue = item.defaultValueCodeFragment.getText();
    String tail = "";
    if(StringUtil.isNotEmpty(defaultValue))
    {
        tail += " argument value = " + defaultValue;
    }
    if(!StringUtil.isEmpty(tail))
    {
        text += " //" + tail;
    }
    return JBListTable.createEditorTextFieldPresentation(getProject(), getFileType(), " " + text, selected, focused);
}
项目:consulo-java    文件:JavaChangeSignatureDialog.java   
@Override
protected JComponent getRowPresentation(ParameterTableModelItemBase<ParameterInfoImpl> item, boolean selected, final boolean focused)
{
    final String typeText = item.typeCodeFragment.getText();
    final String separator = StringUtil.repeatSymbol(' ', getTypesMaxLength() - typeText.length() + 1);
    String text = typeText + separator + item.parameter.getName();
    final String defaultValue = item.defaultValueCodeFragment.getText();
    String tail = "";
    if(StringUtil.isNotEmpty(defaultValue))
    {
        tail += " default value = " + defaultValue;
    }
    if(item.parameter.isUseAnySingleVariable())
    {
        if(StringUtil.isNotEmpty(defaultValue))
        {
            tail += ";";
        }
        tail += " Use any var.";
    }
    if(!StringUtil.isEmpty(tail))
    {
        text += " //" + tail;
    }
    return JBListTable.createEditorTextFieldPresentation(getProject(), getFileType(), " " + text, selected, focused);
}