This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

View | Details | Raw Unified | Return to bug 229350
Collapse All | Expand All

(-)notifications/src/org/netbeans/modules/notifications/center/Bundle.properties (+1 lines)
Lines 42-47 Link Here
42
LBL_NotificationTimestamp=Date Created
42
LBL_NotificationTimestamp=Date Created
43
LBL_NotificationCategory=Category
43
LBL_NotificationCategory=Category
44
LBL_NotificationMessage=Message
44
LBL_NotificationMessage=Message
45
LBL_NotificationIcon=Icon
45
46
46
LBL_CancelFilter=Show All
47
LBL_CancelFilter=Show All
47
LBL_EditFilters=Edit...
48
LBL_EditFilters=Edit...
(-)notifications/src/org/netbeans/modules/notifications/center/NotificationCenterTopComponent.java (-4 / +9 lines)
Lines 211-233 Link Here
211
        int inset = 10;
211
        int inset = 10;
212
        TableColumnModel columnModel = table.getColumnModel();
212
        TableColumnModel columnModel = table.getColumnModel();
213
213
214
        TableColumn priorityColumn = columnModel.getColumn(0);
214
        TableColumn priorityColumn = columnModel.getColumn(NotificationTableModel.PRIORITY_COLUMN);
215
        String priorName = priorityColumn.getHeaderValue().toString();
215
        String priorName = priorityColumn.getHeaderValue().toString();
216
        priorityColumn.setPreferredWidth(fm.stringWidth(priorName) + inset);
216
        priorityColumn.setPreferredWidth(fm.stringWidth(priorName) + inset);
217
217
218
        TableColumn dateColumn = columnModel.getColumn(2);
218
        TableColumn iconColumn = columnModel.getColumn(NotificationTableModel.ICON_COLUMN);
219
        String iconName = iconColumn.getHeaderValue().toString();
220
        iconColumn.setPreferredWidth(fm.stringWidth(iconName) + inset);
221
222
        TableColumn dateColumn = columnModel.getColumn(NotificationTableModel.TIMESTAMP_COLUMN);
219
        dateColumn.setPreferredWidth(15 * maxCharWidth + inset);
223
        dateColumn.setPreferredWidth(15 * maxCharWidth + inset);
220
224
221
        TableColumn categoryColumn = columnModel.getColumn(3);
225
        TableColumn categoryColumn = columnModel.getColumn(NotificationTableModel.CATEGORY_COLUMN);
222
        categoryColumn.setPreferredWidth(7 * maxCharWidth + inset);
226
        categoryColumn.setPreferredWidth(7 * maxCharWidth + inset);
223
227
224
        TableColumn messageColumn = columnModel.getColumn(1);
228
        TableColumn messageColumn = columnModel.getColumn(NotificationTableModel.MESSAGE_COLUMN);
225
        Insets insets = notificationScroll.getBorder().getBorderInsets(notificationScroll);
229
        Insets insets = notificationScroll.getBorder().getBorderInsets(notificationScroll);
226
        int remainingWidth = notificationScroll.getParent().getWidth() - insets.left - insets.right;
230
        int remainingWidth = notificationScroll.getParent().getWidth() - insets.left - insets.right;
227
        remainingWidth -= 3 * columnModel.getColumnMargin();
231
        remainingWidth -= 3 * columnModel.getColumnMargin();
228
        remainingWidth -= priorityColumn.getPreferredWidth();
232
        remainingWidth -= priorityColumn.getPreferredWidth();
229
        remainingWidth -= dateColumn.getPreferredWidth();
233
        remainingWidth -= dateColumn.getPreferredWidth();
230
        remainingWidth -= categoryColumn.getPreferredWidth();
234
        remainingWidth -= categoryColumn.getPreferredWidth();
235
        remainingWidth -= iconColumn.getPreferredWidth();
231
        messageColumn.setPreferredWidth(remainingWidth);
236
        messageColumn.setPreferredWidth(remainingWidth);
232
    }
237
    }
233
238
(-)notifications/src/org/netbeans/modules/notifications/center/NotificationTable.java (+14 lines)
Lines 91-96 Link Here
91
        ecol.setHeaderValue(NbBundle.getMessage(NotificationTable.class, "LBL_NotificationPriority"));
91
        ecol.setHeaderValue(NbBundle.getMessage(NotificationTable.class, "LBL_NotificationPriority"));
92
        ecol.setCellRenderer(new NotificationPriorityRenderer());
92
        ecol.setCellRenderer(new NotificationPriorityRenderer());
93
93
94
        ecol = (ETableColumn) colModel.getColumn(NotificationTableModel.ICON_COLUMN);
95
        ecol.setHeaderValue(NbBundle.getMessage(NotificationTable.class, "LBL_NotificationIcon"));
96
        ecol.setCellRenderer(new NotificationIconRenderer());
97
94
        ecol = (ETableColumn) colModel.getColumn(NotificationTableModel.TIMESTAMP_COLUMN);
98
        ecol = (ETableColumn) colModel.getColumn(NotificationTableModel.TIMESTAMP_COLUMN);
95
        ecol.setHeaderValue(NbBundle.getMessage(NotificationTable.class, "LBL_NotificationTimestamp"));
99
        ecol.setHeaderValue(NbBundle.getMessage(NotificationTable.class, "LBL_NotificationTimestamp"));
96
        ecol.setCellRenderer(new NotificationDateRenderer());
100
        ecol.setCellRenderer(new NotificationDateRenderer());
Lines 165-171 Link Here
165
            return this;
169
            return this;
166
        }
170
        }
167
    }
171
    }
172
    private class NotificationIconRenderer extends NotificationRenderer {
168
173
174
        @Override
175
        public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
176
            super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
177
            setIcon(getNotification(table, row).getIcon());
178
            setText("");
179
            return this;
180
        }
181
    }
182
169
    private class NotificationDateRenderer extends NotificationRenderer {
183
    private class NotificationDateRenderer extends NotificationRenderer {
170
184
171
        @Override
185
        @Override
(-)notifications/src/org/netbeans/modules/notifications/center/NotificationTableModel.java (-4 / +7 lines)
Lines 53-63 Link Here
53
public class NotificationTableModel extends AbstractTableModel {
53
public class NotificationTableModel extends AbstractTableModel {
54
54
55
    static final int PRIORITY_COLUMN = 0;
55
    static final int PRIORITY_COLUMN = 0;
56
    static final int MESSAGE_COLUMN = 1;
56
    static final int ICON_COLUMN = 1;
57
    static final int TIMESTAMP_COLUMN = 2;
57
    static final int MESSAGE_COLUMN = 2;
58
    static final int CATEGORY_COLUMN = 3;
58
    static final int TIMESTAMP_COLUMN = 3;
59
    static final int CATEGORY_COLUMN = 4;
59
60
60
    private static final int COLUMN_COUNT = 4;
61
    private static final int COLUMN_COUNT = 5;
61
62
62
    private final List<NotificationImpl> entries;
63
    private final List<NotificationImpl> entries;
63
64
Lines 89-94 Link Here
89
    public Object getValueAt(int rowIndex, int columnIndex) {
90
    public Object getValueAt(int rowIndex, int columnIndex) {
90
        NotificationImpl notification = getEntry(rowIndex);
91
        NotificationImpl notification = getEntry(rowIndex);
91
        switch (columnIndex) {
92
        switch (columnIndex) {
93
            case ICON_COLUMN:
94
                return notification.getIcon();
92
            case PRIORITY_COLUMN:
95
            case PRIORITY_COLUMN:
93
                return notification.getPriority();
96
                return notification.getPriority();
94
            case TIMESTAMP_COLUMN:
97
            case TIMESTAMP_COLUMN:
(-)notifications/src/rebel.xml (+11 lines)
Line 0 Link Here
1
<!-- Generated by the JRebel NetBeans plugin -->
2
<!-- More information http://zeroturnaround.com/software/jrebel/how-to-configure-rebel-xml/ -->
3
<?xml version="1.0" encoding="UTF-8"?>
4
<application xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.zeroturnaround.com"
5
             txsi:schemaLocation="http://www.zeroturnaround.com http://www.zeroturnaround.com/alderaan/rebel-2_0.xsd">
6
	<classpath>
7
		<dir name="D:\workspace\nb73-main\main\notifications\build\classes"/>
8
9
	</classpath>
10
  
11
</application>  

Return to bug 229350