if (resources == null)
{
return "";
}
TerminalSize terminalSize = shell.getConsole().getShell().getSize();
List<FileResource> fileResources = new ArrayList<>();
List<JavaFieldResource> fieldResources = new ArrayList<>();
List<JavaMethodResource> methodResources = new ArrayList<>();
List<Resource> otherResources = new ArrayList<>();
for (Resource<?> resource : resources)
{
if (resource instanceof FileResource)
{
fileResources.add((FileResource) resource);
}
else if (resource instanceof JavaFieldResource)
{
fieldResources.add((JavaFieldResource) resource);
}
else if (resource instanceof JavaMethodResource)
{
methodResources.add((JavaMethodResource) resource);
}
else
{
otherResources.add(resource);
}
}
StringBuilder sb = new StringBuilder();
if (fileResources.size() > 0)
{
sb.append(getFileFormattedList(fileResources, terminalSize.getHeight(), terminalSize.getWidth()));
}
if (fieldResources.size() > 0)
{
sb.append(Config.getLineSeparator());
sb.append(ShellUtil.colorizeLabel("[fields]"));
sb.append(Config.getLineSeparator());
sb.append(getJavaFieldFormattedList(fieldResources, terminalSize.getHeight(), terminalSize.getWidth()));
}
if (methodResources.size() > 0)
{
sb.append(Config.getLineSeparator());
sb.append(ShellUtil.colorizeLabel("[methods]"));
sb.append(Config.getLineSeparator());
sb.append(getJavaMethodFormattedList(methodResources, terminalSize.getHeight(), terminalSize.getWidth()));
}
if (otherResources.size() > 0)
{
sb.append(getFormattedList(otherResources, terminalSize.getHeight(), terminalSize.getWidth()));
}
return sb.toString();
}