void (final PackageEntryTable packageTable, JBTable result, boolean areStaticImportsEnabled) { ColoredTableCellRenderer packageRenderer = new ColoredTableCellRenderer() { @Override protected void customizeCellRenderer(@NotNull JTable table, Object value, boolean selected, boolean hasFocus, int row, int column) { PackageEntry entry = packageTable.getEntryAt(row); if (entry == PackageEntry.BLANK_LINE_ENTRY) { append(JavaBundle.message("import.layout.panel.blank.line.entry"), SimpleTextAttributes.GRAYED_ATTRIBUTES); } else { TextAttributes attributes = JavaHighlightingColors.KEYWORD.getDefaultAttributes(); append(PsiKeyword.IMPORT, SimpleTextAttributes.fromTextAttributes(attributes)); if (entry.isStatic()) { append(" ", SimpleTextAttributes.REGULAR_ATTRIBUTES); append(PsiKeyword.STATIC, SimpleTextAttributes.fromTextAttributes(attributes)); } append(" ", SimpleTextAttributes.REGULAR_ATTRIBUTES); if (entry == PackageEntry.ALL_OTHER_IMPORTS_ENTRY || entry == PackageEntry.ALL_OTHER_STATIC_IMPORTS_ENTRY) { append(JavaBundle.message("import.layout.panel.all.other.imports"), SimpleTextAttributes.REGULAR_ATTRIBUTES); } else { append(entry.getPackageName() + ".*", SimpleTextAttributes.REGULAR_ATTRIBUTES); } } } }; if (areStaticImportsEnabled) { fixColumnWidthToHeader(result, 0); fixColumnWidthToHeader(result, 2); result.getColumnModel().getColumn(1).setCellRenderer(packageRenderer); result.getColumnModel().getColumn(0).setCellRenderer(new BooleanTableCellRenderer()); result.getColumnModel().getColumn(2).setCellRenderer(new BooleanTableCellRenderer()); } else { fixColumnWidthToHeader(result, 1); result.getColumnModel().getColumn(0).setCellRenderer(packageRenderer); result.getColumnModel().getColumn(1).setCellRenderer(new BooleanTableCellRenderer()); } }