Globals.prefs.getBoolean("exportInOriginalOrder");
if (inOriginalOrder) {
// Sort entries based on their creation order, utilizing the fact
// that IDs used for entries are increasing, sortable numbers.
List<Comparator<BibtexEntry>> comparators = new ArrayList<Comparator<BibtexEntry>>();
comparators.add(new CrossRefEntryComparator());
comparators.add(new IdComparator());
comparatorStack = new FieldComparatorStack<BibtexEntry>(comparators);
} else {
String pri, sec, ter;
boolean priD, secD, terD = false;
boolean inStandardOrder = isSaveOperation ? Globals.prefs.getBoolean("saveInStandardOrder") :
Globals.prefs.getBoolean("exportInStandardOrder");
if (!inStandardOrder) {
// The setting is to save according to the current table order.
pri = Globals.prefs.get("priSort");
sec = Globals.prefs.get("secSort");
// sorted as they appear on the screen.
ter = Globals.prefs.get("terSort");
priD = Globals.prefs.getBoolean("priDescending");
secD = Globals.prefs.getBoolean("secDescending");
terD = Globals.prefs.getBoolean("terDescending");
} else {
// The setting is to save in standard order: author, editor, year
pri = "author";
sec = "editor";
ter = "year";
priD = false;
secD = false;
terD = true;
}
List<Comparator<BibtexEntry>> comparators = new ArrayList<Comparator<BibtexEntry>>();
if (isSaveOperation)
comparators.add(new CrossRefEntryComparator());
comparators.add(new FieldComparator(pri, priD));
comparators.add(new FieldComparator(sec, secD));
comparators.add(new FieldComparator(ter, terD));
comparators.add(new FieldComparator(BibtexFields.KEY_FIELD));