public void widgetSelected(SelectionEvent e) {
fLimitNotificationSpinner.setEnabled(fLimitNotificationCheck.getSelection());
}
});
fLimitNotificationSpinner = new Spinner(limitItemsContainer, SWT.BORDER);
fLimitNotificationSpinner.setMinimum(1);
fLimitNotificationSpinner.setMaximum(30);
fLimitNotificationSpinner.setEnabled(fLimitNotificationCheck.isEnabled() && fLimitNotificationCheck.getSelection());
if (notificationLimit > 0)
fLimitNotificationSpinner.setSelection(notificationLimit);
else
fLimitNotificationSpinner.setSelection(notificationLimit * -1);
Label label = new Label(limitItemsContainer, SWT.None);
label.setText(" news inside the notification");
/* Full Content */
fShowExcerptCheck = new Button(notificationGroup, SWT.CHECK);
fShowExcerptCheck.setText("Show an excerpt of the news content inside the notification");
fShowExcerptCheck.setSelection(fGlobalScope.getBoolean(DefaultPreferences.SHOW_EXCERPT_IN_NOTIFIER));
fShowExcerptCheck.setEnabled(fShowNotificationPopup.getSelection());
/* Only from Tray */
fNotificationOnlyFromTray = new Button(notificationGroup, SWT.CHECK);
fNotificationOnlyFromTray.setText("Show notification only when window is minimized");
fNotificationOnlyFromTray.setSelection(fGlobalScope.getBoolean(DefaultPreferences.SHOW_NOTIFICATION_POPUP_ONLY_WHEN_MINIMIZED));
fNotificationOnlyFromTray.setEnabled(fShowNotificationPopup.getSelection());
/* Auto Close Notifier */
Composite autoCloseContainer = new Composite(notificationGroup, SWT.None);
autoCloseContainer.setLayout(LayoutUtils.createGridLayout(3, 0, 0, 0, 2, false));
fAutoCloseNotifierCheck = new Button(autoCloseContainer, SWT.CHECK);
fAutoCloseNotifierCheck.setText("Close notification automatically after ");
fAutoCloseNotifierCheck.setEnabled(fShowNotificationPopup.getSelection());
fAutoCloseNotifierCheck.setSelection(!fGlobalScope.getBoolean(DefaultPreferences.STICKY_NOTIFICATION_POPUP));
fAutoCloseNotifierCheck.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
fAutoCloseNotifierSpinner.setEnabled(fAutoCloseNotifierCheck.getSelection());
}
});
int notificationAutoCloseValue = fGlobalScope.getInteger(DefaultPreferences.AUTOCLOSE_NOTIFICATION_VALUE);
fAutoCloseNotifierSpinner = new Spinner(autoCloseContainer, SWT.BORDER);
fAutoCloseNotifierSpinner.setMinimum(1);
fAutoCloseNotifierSpinner.setMaximum(99);
fAutoCloseNotifierSpinner.setEnabled(fAutoCloseNotifierCheck.isEnabled() && fAutoCloseNotifierCheck.getSelection());
fAutoCloseNotifierSpinner.setSelection(notificationAutoCloseValue);