# This patch file was generated by NetBeans IDE # Following Index: paths are relative to: D:\workspace\nb73-main\main # This patch can be applied using context Tools: Patch action on respective folder. # It uses platform neutral UTF-8 encoding and \n newlines. # Above lines and this line are ignored by the patching process. Index: notifications/src/org/netbeans/modules/notifications/center/Bundle.properties --- notifications/src/org/netbeans/modules/notifications/center/Bundle.properties +++ notifications/src/org/netbeans/modules/notifications/center/Bundle.properties @@ -42,6 +42,7 @@ LBL_NotificationTimestamp=Date Created LBL_NotificationCategory=Category LBL_NotificationMessage=Message +LBL_NotificationIcon=Icon LBL_CancelFilter=Show All LBL_EditFilters=Edit... Index: notifications/src/org/netbeans/modules/notifications/center/NotificationCenterTopComponent.java --- notifications/src/org/netbeans/modules/notifications/center/NotificationCenterTopComponent.java +++ notifications/src/org/netbeans/modules/notifications/center/NotificationCenterTopComponent.java @@ -211,23 +211,28 @@ int inset = 10; TableColumnModel columnModel = table.getColumnModel(); - TableColumn priorityColumn = columnModel.getColumn(0); + TableColumn priorityColumn = columnModel.getColumn(NotificationTableModel.PRIORITY_COLUMN); String priorName = priorityColumn.getHeaderValue().toString(); priorityColumn.setPreferredWidth(fm.stringWidth(priorName) + inset); - TableColumn dateColumn = columnModel.getColumn(2); + TableColumn iconColumn = columnModel.getColumn(NotificationTableModel.ICON_COLUMN); + String iconName = iconColumn.getHeaderValue().toString(); + iconColumn.setPreferredWidth(fm.stringWidth(iconName) + inset); + + TableColumn dateColumn = columnModel.getColumn(NotificationTableModel.TIMESTAMP_COLUMN); dateColumn.setPreferredWidth(15 * maxCharWidth + inset); - TableColumn categoryColumn = columnModel.getColumn(3); + TableColumn categoryColumn = columnModel.getColumn(NotificationTableModel.CATEGORY_COLUMN); categoryColumn.setPreferredWidth(7 * maxCharWidth + inset); - TableColumn messageColumn = columnModel.getColumn(1); + TableColumn messageColumn = columnModel.getColumn(NotificationTableModel.MESSAGE_COLUMN); Insets insets = notificationScroll.getBorder().getBorderInsets(notificationScroll); int remainingWidth = notificationScroll.getParent().getWidth() - insets.left - insets.right; remainingWidth -= 3 * columnModel.getColumnMargin(); remainingWidth -= priorityColumn.getPreferredWidth(); remainingWidth -= dateColumn.getPreferredWidth(); remainingWidth -= categoryColumn.getPreferredWidth(); + remainingWidth -= iconColumn.getPreferredWidth(); messageColumn.setPreferredWidth(remainingWidth); } Index: notifications/src/org/netbeans/modules/notifications/center/NotificationTable.java --- notifications/src/org/netbeans/modules/notifications/center/NotificationTable.java +++ notifications/src/org/netbeans/modules/notifications/center/NotificationTable.java @@ -91,6 +91,10 @@ ecol.setHeaderValue(NbBundle.getMessage(NotificationTable.class, "LBL_NotificationPriority")); ecol.setCellRenderer(new NotificationPriorityRenderer()); + ecol = (ETableColumn) colModel.getColumn(NotificationTableModel.ICON_COLUMN); + ecol.setHeaderValue(NbBundle.getMessage(NotificationTable.class, "LBL_NotificationIcon")); + ecol.setCellRenderer(new NotificationIconRenderer()); + ecol = (ETableColumn) colModel.getColumn(NotificationTableModel.TIMESTAMP_COLUMN); ecol.setHeaderValue(NbBundle.getMessage(NotificationTable.class, "LBL_NotificationTimestamp")); ecol.setCellRenderer(new NotificationDateRenderer()); @@ -165,7 +169,17 @@ return this; } } + private class NotificationIconRenderer extends NotificationRenderer { + @Override + public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { + super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); + setIcon(getNotification(table, row).getIcon()); + setText(""); + return this; + } + } + private class NotificationDateRenderer extends NotificationRenderer { @Override Index: notifications/src/org/netbeans/modules/notifications/center/NotificationTableModel.java --- notifications/src/org/netbeans/modules/notifications/center/NotificationTableModel.java +++ notifications/src/org/netbeans/modules/notifications/center/NotificationTableModel.java @@ -53,11 +53,12 @@ public class NotificationTableModel extends AbstractTableModel { static final int PRIORITY_COLUMN = 0; - static final int MESSAGE_COLUMN = 1; - static final int TIMESTAMP_COLUMN = 2; - static final int CATEGORY_COLUMN = 3; + static final int ICON_COLUMN = 1; + static final int MESSAGE_COLUMN = 2; + static final int TIMESTAMP_COLUMN = 3; + static final int CATEGORY_COLUMN = 4; - private static final int COLUMN_COUNT = 4; + private static final int COLUMN_COUNT = 5; private final List entries; @@ -89,6 +90,8 @@ public Object getValueAt(int rowIndex, int columnIndex) { NotificationImpl notification = getEntry(rowIndex); switch (columnIndex) { + case ICON_COLUMN: + return notification.getIcon(); case PRIORITY_COLUMN: return notification.getPriority(); case TIMESTAMP_COLUMN: Index: notifications/src/rebel.xml --- notifications/src/rebel.xml +++ notifications/src/rebel.xml @@ -0,0 +1,11 @@ + + + + + + + + + +