@Override public void setValues() { autoResizeMode.setSelected( prefs.getInt(JabRefPreferences.AUTO_RESIZE_MODE) == JTable.AUTO_RESIZE_ALL_COLUMNS); priField.setText(prefs.get(JabRefPreferences.PRIMARY_SORT_FIELD)); secField.setText(prefs.get(JabRefPreferences.SECONDARY_SORT_FIELD)); terField.setText(prefs.get(JabRefPreferences.TERTIARY_SORT_FIELD)); priSort.setSelectedIndex(0); secSort.setSelectedIndex(0); terSort.setSelectedIndex(0); if (prefs.getBoolean(JabRefPreferences.NAMES_AS_IS)) { namesAsIs.setSelected(true); } else if (prefs.getBoolean(JabRefPreferences.NAMES_FIRST_LAST)) { namesFf.setSelected(true); } else if (prefs.getBoolean(JabRefPreferences.NAMES_NATBIB)) { namesNatbib.setSelected(true); } else { namesFl.setSelected(true); } if (prefs.getBoolean(JabRefPreferences.ABBR_AUTHOR_NAMES)) { abbrNames.setSelected(true); } else if (prefs.getBoolean(JabRefPreferences.NAMES_LAST_ONLY)) { lastNamesOnly.setSelected(true); } else { noAbbrNames.setSelected(true); } priDesc.setSelected(prefs.getBoolean(JabRefPreferences.PRIMARY_SORT_DESCENDING)); secDesc.setSelected(prefs.getBoolean(JabRefPreferences.SECONDARY_SORT_DESCENDING)); terDesc.setSelected(prefs.getBoolean(JabRefPreferences.TERTIARY_SORT_DESCENDING)); floatMarked.setSelected(prefs.getBoolean(JabRefPreferences.FLOAT_MARKED_ENTRIES)); abbrNames.setEnabled(!namesNatbib.isSelected()); lastNamesOnly.setEnabled(!namesNatbib.isSelected()); noAbbrNames.setEnabled(!namesNatbib.isSelected()); String numF = prefs.get(JabRefPreferences.NUMERIC_FIELDS); if (numF == null) { numericFields.setText(""); } else { numericFields.setText(numF); } }
@Override public void setValues() { layout1.setText(prefs.get(JabRefPreferences.PREVIEW_0).replaceAll("__NEWLINE__", "\n")); layout2.setText(prefs.get(JabRefPreferences.PREVIEW_1).replaceAll("__NEWLINE__", "\n")); pdfPreview.setSelected(prefs.getBoolean(JabRefPreferences.PDF_PREVIEW)); }
public void setValues() { fileColumn.setSelected(_prefs.getBoolean("fileColumn")); pdfColumn.setSelected(_prefs.getBoolean("pdfColumn")); urlColumn.setSelected(_prefs.getBoolean("urlColumn")); preferUrl.setSelected(!_prefs.getBoolean("preferUrlDoi")); preferDoi.setSelected(_prefs.getBoolean("preferUrlDoi")); fileColumn.setSelected(_prefs.getBoolean("fileColumn")); arxivColumn.setSelected(_prefs.getBoolean("arxivColumn")); /** * begin: special fields ** */ oldRankingColumn = _prefs.getBoolean(SpecialFieldsUtils.PREF_SHOWCOLUMN_RANKING); rankingColumn.setSelected(oldRankingColumn); oldCompcatRankingColumn = _prefs.getBoolean(SpecialFieldsUtils.PREF_RANKING_COMPACT); compactRankingColumn.setSelected(oldCompcatRankingColumn); oldQualityColumn = _prefs.getBoolean(SpecialFieldsUtils.PREF_SHOWCOLUMN_QUALITY); qualityColumn.setSelected(oldQualityColumn); oldPriorityColumn = _prefs.getBoolean(SpecialFieldsUtils.PREF_SHOWCOLUMN_PRIORITY); priorityColumn.setSelected(oldPriorityColumn); oldRelevanceColumn = _prefs.getBoolean(SpecialFieldsUtils.PREF_SHOWCOLUMN_RELEVANCE); relevanceColumn.setSelected(oldRelevanceColumn); oldSyncKeyWords = _prefs.getBoolean(SpecialFieldsUtils.PREF_AUTOSYNCSPECIALFIELDSTOKEYWORDS); syncKeywords.setSelected(oldSyncKeyWords); oldWriteSpecialFields = _prefs.getBoolean(SpecialFieldsUtils.PREF_SERIALIZESPECIALFIELDS); writeSpecialFields.setSelected(oldWriteSpecialFields); // has to be called as last to correctly enable/disable the other settings oldSpecialFieldsEnabled = _prefs.getBoolean(SpecialFieldsUtils.PREF_SPECIALFIELDSENABLED); specialFieldsEnabled.setSelected(!oldSpecialFieldsEnabled); specialFieldsEnabled.setSelected( oldSpecialFieldsEnabled); // Call twice to make sure the ChangeListener is triggered /** * end: special fields ** */ oldShowOneLetterHeadingForIconColumns = _prefs.getBoolean(JabRefPreferences.SHOWONELETTERHEADINGFORICONCOLUMNS); showOneLetterHeadingForIconColumns.setSelected(oldShowOneLetterHeadingForIconColumns); tableRows.clear(); String[] names = _prefs.getStringArray("columnNames"), lengths = _prefs.getStringArray("columnWidths"); for (int i = 0; i < names.length; i++) { if (i < lengths.length) tableRows.add(new TableRow(names[i], Integer.parseInt(lengths[i]))); else tableRows.add(new TableRow(names[i])); } rowCount = tableRows.size() + 5; ncWidth = _prefs.getInt("numberColWidth"); }