-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Fix copy to #13741
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
Fix copy to #13741
Conversation
jabgui/src/main/java/org/jabref/gui/maintable/RightClickMenu.java
Outdated
Show resolved
Hide resolved
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.
Code comments were very useful
ImportHandler importHandler) { | ||
Menu copyToMenu = factory.createMenu(StandardActions.COPY_TO); | ||
copyToMenu.disableProperty().bind( | ||
Bindings.size(stateManager.getOpenDatabases()).lessThan(2) |
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.
Use Action Helper needs multiple datahases
jabref/jabgui/src/main/java/org/jabref/gui/actions/ActionHelper.java
Lines 41 to 43 in dd823a4
public static BooleanExpression needsMultipleDatabases(TabPane tabbedPane) { | |
return Bindings.size(tabbedPane.getTabs()).greaterThan(1); | |
} |
}; | ||
|
||
// EasyBind.subscribe() is not available for lists, therefore "manually" triggering rebuild and subscribing | ||
rebuildMenu.run(); |
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.
You can directly call subscribe on lists:
stateManager.getOpenDatabases().subscribe( Runnable )
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.
use existing methods
Co-authored-by: Christoph <[email protected]>
); | ||
|
||
ObservableList<BibDatabaseContext> openDatabases = stateManager.getOpenDatabases(); | ||
// Menu is created on each right-click, thus we can always assume that the list of open databases is up-to-date |
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.
Comment restates what is obvious from the code context and doesn't provide additional value or reasoning. Comments should add new information not derivable from code.
* upstream/main: (32 commits) Fix path (#13769) Mode aware consistency check (#13584) Refine JBang check (#13765) Add Language Server to the UI and add the integrity/consistency check (#13697) Fix/remove comment code (#13763) New Crowdin updates (#13760) Bump org.openrewrite.rewrite from 7.14.0 to 7.14.1 (#13757) Bump com.autonomousapps:dependency-analysis-gradle-plugin (#13756) Bump dev.langchain4j:langchain4j-bom from 1.2.0 to 1.3.0 in /versions (#13755) Bump jablib/src/main/resources/csl-locales from `fa56de1` to `e29c453` (#13754) Bump com.autonomousapps:dependency-analysis-gradle-plugin (#13753) Bump org.mockito:mockito-core from 5.18.0 to 5.19.0 in /versions (#13752) Bump actions/upload-pages-artifact from 3 to 4 (#13751) Migrate fetchers to Search.g4 ANTLR parser. (#13691) [Junie]: fix: resolve IllegalArgumentException for non-absolute URIs (#13669) Add auto-renaming of linked files on entry data change (#13295) Walkthrough additions (#13745) Switch from zulu to corretto (#13749) New Crowdin updates (#13747) Fix copy to (#13741) ...
The PR #12374 had several issues
This PR fixes it.
Steps to test
Mandatory checks
CHANGELOG.md
described in a way that is understandable for the average user (if change is visible to the user)