-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Web Import: Add New Entries to 'Imported Entries' Group #12998
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
base: main
Are you sure you want to change the base?
Changes from all commits
2732800
badbb25
878b42c
91575ba
6697a64
152cfed
46dec7a
571d436
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ | |
import org.jabref.model.groups.ExplicitGroup; | ||
import org.jabref.model.groups.KeywordGroup; | ||
import org.jabref.model.groups.SearchGroup; | ||
import org.jabref.model.groups.SmartGroup; | ||
import org.jabref.model.strings.StringUtil; | ||
|
||
public class GroupDescriptions { | ||
|
@@ -61,6 +62,10 @@ public static String getShortDescriptionAllEntriesGroup() { | |
return Localization.lang("<b>All Entries</b> (this group cannot be edited or removed)"); | ||
} | ||
|
||
public static String getShortDescriptionSmartGroup(SmartGroup smartGroup) { | ||
return Localization.lang("<b>Smart Group</b> (Import Entries)"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The string 'Smart Group' should be in sentence case as per the guidelines, so it should be 'Smart group'. |
||
} | ||
|
||
public static String getShortDescription(SearchGroup searchGroup, boolean showDynamic) { | ||
StringBuilder sb = new StringBuilder(); | ||
sb.append("<b>"); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,7 @@ | |
import org.jabref.model.groups.GroupTreeNode; | ||
import org.jabref.model.groups.KeywordGroup; | ||
import org.jabref.model.groups.SearchGroup; | ||
import org.jabref.model.groups.SmartGroup; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The code uses Java SWING imports, which contradicts the instruction to use only JavaFX for UI technology. This could lead to inconsistencies in the UI framework used. |
||
|
||
public class GroupTreeNodeViewModel { | ||
private final GroupTreeNode node; | ||
|
@@ -51,6 +52,8 @@ public String getDescription() { | |
String shortDescription = ""; | ||
boolean showDynamic = true; | ||
shortDescription = switch (group) { | ||
case SmartGroup smartGroup -> | ||
GroupDescriptions.getShortDescriptionSmartGroup(smartGroup); | ||
case ExplicitGroup explicitGroup -> | ||
GroupDescriptions.getShortDescriptionExplicitGroup(explicitGroup); | ||
case KeywordGroup keywordGroup -> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,6 +33,8 @@ public class WebSearchTab extends AbstractPreferenceTabView<WebSearchTabViewMode | |
@FXML private CheckBox warnAboutDuplicatesOnImport; | ||
@FXML private CheckBox downloadLinkedOnlineFiles; | ||
@FXML private CheckBox keepDownloadUrl; | ||
@FXML private CheckBox addImportedEntries; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The variable name 'addImportedEntries' should be in camel-case format, such as 'addImportedEntriesCheckBox', to improve readability and maintain consistency with Java naming conventions. |
||
@FXML private TextField addImportedEntriesGroupName; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The variable name 'addImportedEntriesGroupName' should be in camel-case format, such as 'importedEntriesGroupNameField', to improve readability and maintain consistency with Java naming conventions. |
||
@FXML private ComboBox<PlainCitationParserChoice> defaultPlainCitationParser; | ||
|
||
@FXML private CheckBox useCustomDOI; | ||
|
@@ -76,6 +78,10 @@ public void initialize() { | |
downloadLinkedOnlineFiles.selectedProperty().bindBidirectional(viewModel.shouldDownloadLinkedOnlineFiles()); | ||
keepDownloadUrl.selectedProperty().bindBidirectional(viewModel.shouldKeepDownloadUrl()); | ||
|
||
addImportedEntries.selectedProperty().bindBidirectional(viewModel.getAddImportedEntries()); | ||
addImportedEntriesGroupName.textProperty().bindBidirectional(viewModel.getAddImportedEntriesGroupName()); | ||
addImportedEntriesGroupName.disableProperty().bind(addImportedEntries.selectedProperty().not()); | ||
paudelritij marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
new ViewModelListCellFactory<PlainCitationParserChoice>() | ||
.withText(PlainCitationParserChoice::getLocalizedName) | ||
.install(defaultPlainCitationParser); | ||
|
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.
The method getShortDescriptionSmartGroup returns a String, which could potentially be null. New public methods should not return null and should use java.util.Optional instead.