@Override public void setValues() { if (prefs.getBoolean(JabRefPreferences.EXPORT_IN_ORIGINAL_ORDER)) { exportInOriginalOrder.setSelected(true); } else if (prefs.getBoolean(JabRefPreferences.EXPORT_IN_SPECIFIED_ORDER)) { exportInSpecifiedOrder.setSelected(true); } else { exportInTableOrder.setSelected(true); } boolean selected = prefs.getBoolean(JabRefPreferences.EXPORT_IN_SPECIFIED_ORDER); exportOrderPanel.setEnabled(selected); exportOrderPanel.setSaveOrderConfig(SaveOrderConfig.loadExportSaveOrderFromPreferences(prefs)); }
@Override public void storeSettings() { prefs.putBoolean( JabRefPreferences.EXPORT_IN_ORIGINAL_ORDER, exportInOriginalOrder.isSelected()); prefs.putBoolean( JabRefPreferences.EXPORT_IN_SPECIFIED_ORDER, exportInSpecifiedOrder.isSelected()); exportOrderPanel.getSaveOrderConfig().storeAsExportSaveOrderInPreferences(prefs); }
public FileSortTab(JabRefPreferences prefs) { this.prefs = prefs; FormLayout layout = new FormLayout("4dlu, left:pref, 4dlu, fill:pref", ""); DefaultFormBuilder builder = new DefaultFormBuilder(layout); builder.leadingColumnOffset(1); // EXPORT SORT ORDER // create Components exportInOriginalOrder = new JRadioButton(Localization.lang("Export entries in their original order")); exportInTableOrder = new JRadioButton(Localization.lang("Export in current table sort order")); exportInSpecifiedOrder = new JRadioButton(Localization.lang("Export entries ordered as specified")); ButtonGroup buttonGroup = new ButtonGroup(); buttonGroup.add(exportInOriginalOrder); buttonGroup.add(exportInTableOrder); buttonGroup.add(exportInSpecifiedOrder); ActionListener listener = new ActionListener() { @Override public void actionPerformed(ActionEvent e) { boolean selected = e.getSource() == exportInSpecifiedOrder; exportOrderPanel.setEnabled(selected); } }; exportInOriginalOrder.addActionListener(listener); exportInTableOrder.addActionListener(listener); exportInSpecifiedOrder.addActionListener(listener); // create GUI builder.appendSeparator(Localization.lang("Export sort order")); builder.append(exportInOriginalOrder, 1); builder.nextLine(); builder.append(exportInTableOrder, 1); builder.nextLine(); builder.append(exportInSpecifiedOrder, 1); builder.nextLine(); exportOrderPanel = new SaveOrderConfigDisplay(); builder.append(exportOrderPanel.getPanel()); builder.nextLine(); // COMBINE EVERYTHING JPanel pan = builder.getPanel(); pan.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); setLayout(new BorderLayout()); add(pan, BorderLayout.CENTER); }