Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dash in list of illegal chars #6299

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Note that this project **does not** adhere to [Semantic Versioning](http://semve

### Fixed

- We fixed an issue where sort by priority was broken. [#6222](https://github.com/JabRef/jabref/issues/6222)
- We fixed an issue where opening a library from the recent libraries menu was not possible. [#5939](https://github.com/JabRef/jabref/issues/5939)
- We fixed an issue with inconsistent capitalization of file extensions when downloading files [#6115](https://github.com/JabRef/jabref/issues/6115)
- We fixed the display of language and encoding in the preferences dialog. [#6130](https://github.com/JabRef/jabref/pull/6130)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
import org.jabref.gui.specialfields.SpecialFieldsPreferences;
import org.jabref.gui.util.OptionalValueTableCellFactory;
import org.jabref.gui.util.ValueTableCellFactory;
import org.jabref.gui.util.comparator.PriorityFieldComparator;
import org.jabref.gui.util.comparator.RankingFieldComparator;
import org.jabref.gui.util.comparator.ReadStatusFieldComparator;
import org.jabref.logic.l10n.Localization;
Expand Down Expand Up @@ -316,6 +317,10 @@ private TableColumn<BibEntryTableViewModel, Optional<SpecialFieldValueViewModel>
column.setComparator(new ReadStatusFieldComparator());
}

if (specialField == SpecialField.PRIORITY) {
column.setComparator(new PriorityFieldComparator());
}

column.setSortable(true);

return column;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package org.jabref.gui.util.comparator;

import java.util.Comparator;
import java.util.Optional;

import org.jabref.gui.specialfields.SpecialFieldValueViewModel;

public class PriorityFieldComparator implements Comparator<Optional<SpecialFieldValueViewModel>> {

@Override
public int compare(Optional<SpecialFieldValueViewModel> val1, Optional<SpecialFieldValueViewModel> val2) {
if (val1.isPresent()) {
if (val2.isPresent()) {
return val1.get().getValue().compareTo(val2.get().getValue());
} else {
return -1;
}
} else {
if (val2.isPresent()) {
return 1;
} else {
return 0;
}
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public class BibtexKeyGenerator extends BracketedPattern {
*/
public static final String APPENDIX_CHARACTERS = "abcdefghijklmnopqrstuvwxyz";
private static final Logger LOGGER = LoggerFactory.getLogger(BibtexKeyGenerator.class);
private static final String KEY_ILLEGAL_CHARACTERS = "{}(),\\\"-#~^:'`ʹ";
private static final String KEY_ILLEGAL_CHARACTERS = "{}(),\\\"#~^:'`ʹ";
private static final String KEY_UNWANTED_CHARACTERS = "{}(),\\\"-";
private final AbstractBibtexKeyPattern citeKeyPattern;
private final BibDatabase database;
Expand Down