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

Add disable/enable calculation of items in group (2) #6244

Closed
wants to merge 84 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
84 commits
Select commit Hold shift + click to select a range
72c022e
Adjusted GroupNodeViewModel.java.
Gena928 Apr 5, 2020
1f4e4ad
Adjusted GroupNodeViewModel.
Gena928 Apr 6, 2020
ebd6284
Update GroupNodeViewModel.java
Gena928 Apr 6, 2020
c0990dc
Injected PreferencesService using a constructor call.
Gena928 Apr 11, 2020
1b5d16d
Merge branch 'master' into 6042(2)
tobiasdiez Apr 28, 2020
f6c12f4
Update GroupNodeViewModel.java
tobiasdiez Apr 28, 2020
3f368e9
Fixed an issue where a new entry is not shown in the library if a fil…
nsmt09 May 1, 2020
c8da256
Partial fix for issue 5891
May 8, 2020
ce33357
Added more tests
May 8, 2020
3df1342
Added more tests
May 9, 2020
5454a09
Added more tests
May 9, 2020
e066958
Merge branch 'fix-for-issue-5891' of https://github.com/silverhorse/j…
May 12, 2020
40541ad
Small update to resolve GIT conflict
Gena928 May 22, 2020
9287490
Return true in action helper if file is online link
Siedlerchr May 22, 2020
d4f23fa
fix checkstyle
Siedlerchr May 22, 2020
b1e899a
Adjusted fix by using StateManager for clearing search bar
nsmt09 May 22, 2020
a9eeb05
Merge branch 'master' into fix-for-issue-6297
Siedlerchr May 22, 2020
7748940
Update ActionHelper.java
tobiasdiez May 22, 2020
c8344be
Merge branch 'master' into 6042(2)
tobiasdiez May 22, 2020
dffcf78
Merge pull request #6511 from JabRef/fixActionHelperWithOnlineLink
Siedlerchr May 22, 2020
2c1a69e
Refactored tableColumnsTab and tableTab, changed to PreferencesService
calixtus May 22, 2020
9882c6d
Fix help file tests
tobiasdiez May 23, 2020
e277c0c
Remove Grobid also from tests
tobiasdiez May 23, 2020
e76a92c
Extend the bib file for better screenshots
tobiasdiez May 23, 2020
03e3663
Refactor externalprefs (#6509)
calixtus May 23, 2020
3e96170
Merge pull request #6513 from JabRef/fetcherHelp
Siedlerchr May 24, 2020
737af75
Add javadoc and fix the preview update issue
leitianjian May 24, 2020
2a5717c
Merged entry table tabs
calixtus May 24, 2020
ab50ca8
Refactored MainTableNameFormatter
calixtus May 24, 2020
cb6804e
CHANGELOG.md
calixtus May 24, 2020
fa5f879
Merge pull request #6514 from JabRef/extendBib
Siedlerchr May 24, 2020
c8949bd
Added cache and comments
calixtus May 24, 2020
ead191e
Merge remote-tracking branch 'upstream/master' into refactor_tableprefs
calixtus May 24, 2020
8d468cb
Bump flexmark-ext-gfm-tasklist from 0.61.30 to 0.61.32
dependabot-preview[bot] May 25, 2020
4f75f57
Bump flexmark from 0.61.30 to 0.61.32
dependabot-preview[bot] May 25, 2020
196f937
Bump archunit-junit5-api from 0.13.1 to 0.14.1
dependabot-preview[bot] May 25, 2020
20c70a9
Merge pull request #6520 from JabRef/dependabot/gradle/com.vladsch.fl…
Siedlerchr May 25, 2020
7d3bd7b
Merge pull request #6521 from JabRef/dependabot/gradle/com.vladsch.fl…
Siedlerchr May 25, 2020
59361fc
Bump flexmark-ext-gfm-strikethrough from 0.61.30 to 0.61.32
dependabot-preview[bot] May 25, 2020
43262c3
Merge pull request #6522 from JabRef/dependabot/gradle/com.vladsch.fl…
Siedlerchr May 25, 2020
bc1e341
Merge pull request #6523 from JabRef/dependabot/gradle/com.tngtech.ar…
Siedlerchr May 25, 2020
d01f370
Fixed main table refresh
calixtus May 25, 2020
b86800c
Revert to old switch expression for checkstyle compatibility
calixtus May 25, 2020
0bd2fd2
Revert more switch expressions for checkstyle compatibility
calixtus May 25, 2020
25bd506
CHANGELOG.md
calixtus May 25, 2020
6f34de3
Merge pull request #6407 from nsmt09/fix-for-issue-6297
Siedlerchr May 25, 2020
86b04a7
Merge pull request #6516 from leitianjian/entry-preview-content-update
Siedlerchr May 25, 2020
0d7156b
Fixes missing library properties context menu on library tab (#6508)
Oltman-B May 26, 2020
861e61e
Allow entrytype as sorting criterion
Siedlerchr May 27, 2020
56b0cee
update changelog
Siedlerchr May 27, 2020
104f697
checkstyle argh
Siedlerchr May 27, 2020
bb19d29
Merge pull request #6531 from JabRef/fixEntryTypeMissing
Siedlerchr May 27, 2020
47846bf
Enable users to simultaneously search all SearchBasedFetchers (#6504)
DominikVoigt May 27, 2020
c119ca2
Add markdown checks (and fix some markdown issues) (#6524)
koppor May 27, 2020
4b997f8
updating text for checkbox
May 28, 2020
5668049
reverting change from other properties files
May 28, 2020
62a6961
Merge branch 'master' of https://github.com/JabRef/jabref into fix-fo…
May 28, 2020
08eccb6
Fixes generated bibtex key and display of institute authors (#6479)
k3KAW8Pnf7mkmdSMPHz27 May 28, 2020
62f3038
Merge remote-tracking branch 'upstream/master' into refactor_tableprefs
calixtus May 28, 2020
3135197
Extracted JabRefPrefences out of PersistenceVisualStateTable
calixtus May 28, 2020
526ba89
Fix links in the readme
tobiasdiez May 28, 2020
0ce7c8f
updating text
May 28, 2020
6a1940f
updating text
May 28, 2020
ffa07cd
Merge pull request #6451 from silverhorse/fix-for-issue-5891
Siedlerchr May 28, 2020
d43bcfa
Switch to upstream version of markdow-lint (#6544)
koppor May 28, 2020
c1867e5
Fixed merge error
calixtus May 28, 2020
41678ce
Merge pull request #6518 from JabRef/refactor_tableprefs
Siedlerchr May 28, 2020
ad8ac9d
Bump flexmark from 0.61.32 to 0.62.0
dependabot-preview[bot] May 28, 2020
4eb2316
Bump flexmark-ext-gfm-tasklist from 0.61.32 to 0.62.0
dependabot-preview[bot] May 28, 2020
cab28ab
Bump bcprov-jdk15on from 1.65 to 1.65.01
dependabot-preview[bot] May 28, 2020
8ff20f1
Merge pull request #6550 from JabRef/dependabot/gradle/org.bouncycast…
Siedlerchr May 29, 2020
a852963
Merge pull request #6547 from JabRef/dependabot/gradle/com.vladsch.fl…
Siedlerchr May 29, 2020
5cb139c
Merge pull request #6548 from JabRef/dependabot/gradle/com.vladsch.fl…
Siedlerchr May 29, 2020
8b35b69
Restructure first paragraph
koppor May 29, 2020
2c30f20
Fix html
koppor May 29, 2020
9742ee1
Bump flexmark-ext-gfm-strikethrough from 0.61.32 to 0.62.0 (#6546)
dependabot-preview[bot] May 29, 2020
53e8c36
Add authors
koppor May 29, 2020
68f90c0
Merge branch '6042(2)' of git://github.com/Gena928/jabref into Gena92…
calixtus May 29, 2020
684abf6
Adjusted GroupNodeViewModel.java.
Gena928 Apr 5, 2020
58e5492
Adjusted GroupNodeViewModel.
Gena928 Apr 6, 2020
2155917
Update GroupNodeViewModel.java
Gena928 Apr 6, 2020
30cb675
Injected PreferencesService using a constructor call.
Gena928 Apr 11, 2020
5c1998f
Update GroupNodeViewModel.java
tobiasdiez Apr 28, 2020
2da0d06
Merge branch '6042(2)' of https://github.com/Gena928/jabref into 6042(2)
calixtus May 29, 2020
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
16 changes: 12 additions & 4 deletions src/main/java/org/jabref/gui/groups/GroupNodeViewModel.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
import java.util.Optional;
import java.util.stream.Collectors;

import javax.inject.Inject;

import javafx.beans.binding.Bindings;
import javafx.beans.binding.BooleanBinding;
import javafx.beans.property.SimpleBooleanProperty;
Expand Down Expand Up @@ -37,6 +39,8 @@
import org.jabref.model.groups.GroupEntryChanger;
import org.jabref.model.groups.GroupTreeNode;
import org.jabref.model.strings.StringUtil;
import org.jabref.preferences.JabRefPreferences;
import org.jabref.preferences.PreferencesService;

import com.google.common.base.Enums;
import de.jensd.fx.glyphs.materialdesignicons.MaterialDesignIcon;
Expand All @@ -59,13 +63,15 @@ public class GroupNodeViewModel {
private final CustomLocalDragboard localDragBoard;
private final ObservableList<BibEntry> entriesList;
private final DelayTaskThrottler throttler;
@Inject private PreferencesService preferencesService;

public GroupNodeViewModel(BibDatabaseContext databaseContext, StateManager stateManager, TaskExecutor taskExecutor, GroupTreeNode groupNode, CustomLocalDragboard localDragBoard) {
Gena928 marked this conversation as resolved.
Show resolved Hide resolved
this.databaseContext = Objects.requireNonNull(databaseContext);
this.taskExecutor = Objects.requireNonNull(taskExecutor);
this.stateManager = Objects.requireNonNull(stateManager);
this.groupNode = Objects.requireNonNull(groupNode);
this.localDragBoard = Objects.requireNonNull(localDragBoard);
this.preferencesService = JabRefPreferences.getInstance();
Gena928 marked this conversation as resolved.
Show resolved Hide resolved

displayName = new LatexToUnicodeFormatter().format(groupNode.getName());
isRoot = groupNode.isRoot();
Expand Down Expand Up @@ -229,10 +235,12 @@ private void calculateNumberOfMatches() {
// We calculate the new hit value
// We could be more intelligent and try to figure out the new number of hits based on the entry change
// for example, a previously matched entry gets removed -> hits = hits - 1
BackgroundTask
.wrap(() -> groupNode.calculateNumberOfMatches(databaseContext.getDatabase()))
.onSuccess(hits::setValue)
.executeWith(taskExecutor);
if (preferencesService.getDisplayGroupCount()) {
BackgroundTask
.wrap(() -> groupNode.calculateNumberOfMatches(databaseContext.getDatabase()))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this duplication of the code is a result from a merge conflict?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like yes, this is a conflict.
the second BackgroundTask is not mine. My code is:

    private void calculateNumberOfMatches() {
        // We calculate the new hit value
        // We could be more intelligent and try to figure out the new number of hits based on the entry change
        // for example, a previously matched entry gets removed -> hits = hits - 1
        if (preferencesService.getDisplayGroupCount()) {
            BackgroundTask
                    .wrap(() -> groupNode.calculateNumberOfMatches(databaseContext.getDatabase()))
                    .onSuccess(hits::setValue)
                    .executeWith(taskExecutor);
        }
    }

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I haven't worked with conflicts yet.
Looks like this is your correction as of 11.04.2020. Can I do something to resolve this GIT conflict?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No problem! I also often have problems with git ;-)

Here the solution is relatively simple. Just edit the code and remove the part that is duplicated / not correct. Then commit and push.

.onSuccess(hits::setValue)
.executeWith(taskExecutor);
}
}

public GroupTreeNode addSubgroup(AbstractGroup subgroup) {
Expand Down
4 changes: 1 addition & 3 deletions src/main/java/org/jabref/gui/groups/GroupTreeView.java
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,7 @@ public void initialize() {
group.allSelectedEntriesMatchedProperty());
}
Text text = new Text();
if (preferencesService.getDisplayGroupCount()) {
text.textProperty().bind(group.getHits().asString());
}
text.textProperty().bind(group.getHits().asString());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please leave this if check here, otherwise every group will have a 0 here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good day,
OK, adjusted in code. Will commit today, when we find solution about PreferencesService in GroupNodeViewModel (see comment from calixtus).

text.getStyleClass().setAll("text");
node.getChildren().add(text);
node.setMaxWidth(Control.USE_PREF_SIZE);
Expand Down