JComponent (@Nullable DiffViewer viewer, @Nullable JComponent title, @Nullable DiffContent content) { List<JComponent> components = new ArrayList<>(); if (title != null) components.add(title); if (content != null) { components.addAll(createCustomNotifications(viewer, content)); } if (content instanceof DocumentContent) { Document document = ((DocumentContent)content).getDocument(); if (FileDocumentManager.getInstance().isPartialPreviewOfALargeFile(document)) { components.add(wrapEditorNotificationComponent( DiffNotifications.createNotification(DiffBundle.message("error.file.is.too.large.only.preview.is.loaded")))); } } if (components.isEmpty()) return null; return createStackedComponents(components, TITLE_GAP); }