private void initComponents(ValueModel triggerChannel)
{
chShowTipsBox = ComponentsFactory.createCheckBox(
Strings.message("userprefs.tab.general.show.tip.of.the.day"),
new ToggleButtonAdapter(new BufferedValueModel(TipOfTheDayDialog.showingTipsModel(),
triggerChannel)));
String msg = Strings.message("userprefs.tab.general.check.for.new.versions");
if (ApplicationLauncher.isAutoUpdatesEnabled())
{
chDoUpdatesCheck = ComponentsFactory.createCheckBox(
msg, new ToggleButtonAdapter(new BufferedValueModel(new PropertyAdapter(userPrefs,
UserPreferences.PROP_CHECKING_FOR_UPDATES_ON_STARTUP),
triggerChannel)));
} else
{
msg = msg.replaceAll("&", "");
chDoUpdatesCheck = new JCheckBox(msg);
chDoUpdatesCheck.setSelected(true);
chDoUpdatesCheck.setEnabled(false);
}
chAlwaysUseEnglish = ComponentsFactory.createCheckBox(
Strings.message("userprefs.tab.advanced.always.use.english"),
new ToggleButtonAdapter(new BufferedValueModel(new PropertyAdapter(userPrefs,
UserPreferences.PROP_ALWAYS_USE_ENGLISH),
triggerChannel)));
tfInternetBrowser = new JTextField();
tfInternetBrowser.setDocument(new DocumentAdapter(new BufferedValueModel(
new PropertyAdapter(userPrefs, UserPreferences.PROP_INTERNET_BROWSER),
triggerChannel)));
if (BrowserLauncher.isUsingJWSBrowser())
{
tfInternetBrowser.setEnabled(false);
tfInternetBrowser.setToolTipText(Strings.message("userprefs.tab.advanced.browser.tooltip.disabled"));
} else
{
tfInternetBrowser.setEnabled(true);
tfInternetBrowser.setToolTipText(Strings.message("userprefs.tab.advanced.browser.tooltip.enabled"));
}
initProxyComponents(triggerChannel);
SpinnerModelAdapter spinModelFeedSelectionDelay = new SpinnerModelAdapter(
new BoundedRangeAdapter(new BufferedValueModel(new PropertyAdapter(userPrefs,
UserPreferences.PROP_FEED_SELECTION_DELAY), triggerChannel), 0, 0, 1000));
spinModelFeedSelectionDelay.setStepSize(100);
chAAText = createCheckBox(userPrefs, Strings.message("userprefs.tab.advanced.antialiased.fonts"),
UserPreferences.PROP_AA_TEXT);
// The following code registers listener on Apply/Accept actions to track down
// changes in BlogStarz limits. If changes are detected then channel list is
// repainted.
saveInitialLimits();
triggerChannel.addValueChangeListener(new PropertyChangeListener()
{
public void propertyChange(PropertyChangeEvent evt)
{
if (Boolean.TRUE.equals(evt.getNewValue())) doRepaintChannelList();
}
});
chShowUnreadButtonMenu = createCheckBox(userPrefs,
Strings.message("userprefs.tab.advanced.show.the.unread.buttons.menu"),
UserPreferences.PROP_SHOW_UNREAD_BUTTON_MENU);
SpinnerModelAdapter spinModelFeedImportLimit =
new SpinnerModelAdapter(new BoundedRangeAdapter(
new BufferedValueModel(new PropertyAdapter(userPrefs,
UserPreferences.PROP_FEED_IMPORT_LIMIT),
triggerChannel), 1, 1, UserPreferences.MAX_FEED_IMPORT_LIMITATION));
spinModelFeedImportLimit.setStepSize(100);
spinFeedImportLimit = new JSpinner(spinModelFeedImportLimit);
initGuideComponents(triggerChannel);
chHideOldArticles = createCheckBox(feedRS,
Strings.message("userprefs.tab.articles.hide.articles.older.than"), "suppressingOlderThan");
chDisplayFullTitles = createCheckBox(feedRS,
Strings.message("userprefs.tab.articles.display.full.titles"), "displayingFullTitles");
chSortingAscending = createCheckBox(feedRS,
Strings.message("userprefs.tab.articles.sort.earlier.articles.first"), "sortingAscending");
tfSuppressOlderThan = new JTextField();
tfSuppressOlderThan.setDocument(new DocumentAdapter(new BufferedValueModel(
new PropertyAdapter(feedRS, "suppressOlderThanString"), triggerChannel)));
chCopyLinksInHREFFormat = createCheckBox(userPrefs,
Strings.message("userprefs.tab.articles.use.href.format.for.links.copied.to.clipboard"),
UserPreferences.PROP_COPY_LINKS_IN_HREF_FORMAT);
chBrowseOnTitleDblClick = createCheckBox(userPrefs,
Strings.message("userprefs.tab.articles.browse.on.double.click.over.the.title"),
UserPreferences.PROP_BROWSE_ON_DBL_CLICK);
chShowAppIconInSystray = createCheckBox(userPrefs,
Strings.message("userprefs.tab.advanced.show.appicon.in.systray"),
UserPreferences.PROP_SHOW_APPICON_IN_SYSTRAY);
chMinimizeToSystray = createCheckBox(userPrefs,
Strings.message("userprefs.tab.advanced.minimize.to.systray"),
UserPreferences.PROP_MINIMIZE_TO_SYSTRAY);
// Dock icon
ValueModel modeModel = new BufferedValueModel(
new BIDModeToStringConverter(new PropertyAdapter(userPrefs, UserPreferences.PROP_DIB_MODE)),
triggerChannel);
cbBIDMode = new JComboBox(new ComboBoxAdapter(BIDModeToStringConverter.MODES, modeModel));
}