-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Make automatic groups a first-class citizien #2563
Conversation
} else { | ||
if (editedGroup.getClass() == WordKeywordGroup.class) { | ||
WordKeywordGroup group = (WordKeywordGroup) editedGroup; | ||
nameField.setText(group.getName()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer a switch case here, but that is a minor thing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to the Java language specifications
The type of the Expression must be char, byte, short, int, Character, Byte, Short, Integer, String, or an enum type, or a compile-time error occurs.
thus switch over a class type does not work.
keywordGroupCaseSensitive.setSelected(group.isCaseSensitive()); | ||
keywordGroupRegExp.setSelected(false); | ||
keywordsRadioButton.setSelected(true); | ||
setContext(editedGroup.getHierarchicalContext()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move set context out of the ifs as it is called always with the same parameter
Same for set Name
You call a mere thousand changes "line harvesting"? Pathetic! ;-) Fun aside, please do not take this as a justification to blow up the number of LOC in your PR. I have a more general comment: The handling of special fields is pretty much the same as you do here. Have a look at the (deprecated) class I haven't given much thought at how to unify these two features with the common logic, but maybe you could give it a try here? The special fields are much less ugly now than they used to be, promise! |
I fear I cannot completely follow you @lenhard.
Thus the only logic that seems to be shared by these features is the extraction of a list of keywords from a string and this is already encapsulated in the |
Side topic: @stfnklb and me discussed whether we should use jrkeywords as
field. Reason: keywords are the keywords from the paper and users want to
keep them. - By this, we separate paper data from meta data on
bibliographical data...
Am 22.02.2017 20:57 schrieb "Tobias Diez" <[email protected]>:
… I fear I cannot completely follow you @lenhard
<https://github.com/lenhard>.
- If I understand the special fields correctly, then they sync the
content of some field (like rank = 1) with the keywords field (keywords
= rank1).
- The automatic groups take the contents of some field (e.g. keywords
= foo, bar) and creates dynamic groups for each keyword (i.e. a group
matching foo and one for bar). However, these groups are only created
for the display and not written to groups tree in the bib file. Moreover,
this features is completely independent of the groups field that is
only used for the static groups.
Thus the only logic that seems to be shared by these features is the
extraction of a list of keywords from a string and this is already
encapsulated in the KeywordList class. What do I miss?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#2563 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ABTafpYet7gvjqVeXHYDg-xn92-46gbxks5rfJNDgaJpZM4MEfJ2>
.
|
@tobiasdiez From your answer, I think that you have understood me correctly. It was just an idea and might not be worthwhile. Since the special fields synchronization already builds upon @koppor: Although what you say is true, I do not know of any user complaint about this behavior (which is telling). In contrast, changing the semantics of the keyword field in JabRef will confuse a lot of users, I would expect. |
Ok, I merge now and will have a second look about the SpecialFields later. |
* upstream/master: (21 commits) Implement #1904: filter groups (#2588) Braces checking followup (#2598) Improve braces checking (#2593) Fix pdf file import when only one file selected and no entry created (#2592) Fix test Imports Localization: MainFile: French: update (#2591) isPdf helper method Add asString with UTF-8 as standard encoding Fix names of groups in "add/move to group" dialog Make automatic groups a first-class citizien (#2563) Rename downloadToString method to asString Refactoring method names Inline Mime type detection Fix imports Extract SSL bypassing Bypass SSL functionality Unused methods and refactoring Always use browser user agent Monitored URLDownload is currently not use anywhere ... # Conflicts: # CHANGELOG.md
So after you guys had your fun in Lugano (and harvested a big number of changed lines), I want to have my share too. Thus here I'm with a new groups-related PR.
Previously there was the option to automatically generate a bunch of groups. For example based on the keywords contained in a certain field. However, this process was a one-time thing, which means that once the groups were created they were not keep in sync with changes to the entries.
In this PR, I introduce the automatic groups as a new type of groups that based on a certain criteria automatically create subgroups and keep them synchronized with the changes.
The current implementation has a few caveats which I would like to address in a new PR:
Remark: Our architecture tests threw a NPE instead of a meaningful message in case of an issue. This is also fixed.
gradle localizationUpdate
?