super(haxeNamedComponent, buildPresentationText(haxeNamedComponent), haxeNamedComponent.getIcon(Iconable.ICON_FLAG_VISIBILITY));
}
@Nullable
private static String buildPresentationText(HaxeNamedComponent haxeNamedComponent) {
final ItemPresentation presentation = haxeNamedComponent.getPresentation();
if (presentation == null) {
return haxeNamedComponent.getName();
}
final StringBuilder result = new StringBuilder();
if (haxeNamedComponent instanceof HaxeClass) {
result.append(haxeNamedComponent.getName());
final String location = presentation.getLocationString();
if (location != null && !location.isEmpty()) {
result.append(" ").append(location);
}
}
else {
result.append(presentation.getPresentableText());
}
return result.toString();
}