Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[GSOC22] - A - Implement a fully functional three way merge UI (#8945)
* Update README.md * Fix Readme * Create grid cells for rendering field name and field value * Implement FieldNameCell and define style class * Make FieldValueCell selectable - Defined style class - Defined pseudo class for the selected state - Created the selection box UI * Implement MergedFieldCell for rendering editable merged field value * Change MergedFieldCell text based on the selected FieldValueCell * Style MergedFieldCell * Rename ThreeWayMerge css stylesheet * Create HeadView for rendering left, right and merged entry headers * Fix typo * Fix a bug that causes the selection of both left and right field cells simultaneously. - Added a style class for field value cell * Prevent the selection of FieldValueCell when it's disabled - A cell is disabled when it's either empty or not visible e.g. when the left cell spans 2 columns, right cell is disabled because it's not visible - Added comments * Display a copy icon inside FieldValueCell * Disable left or right FieldValueCell when it's empty - Added getters for row cells * Update Base CSS style * Design and implement the merge toolbox - It will be added to the top of the merge dialog * Implement the initial prototype of the new merge UI - Renamed ThreeWayMerge.java to ThreeWayMergeView * Use ThreeWayMergeView in MergeEntriesDialog - At this stage headers aren't updated and merged bib entry is not created * Fix ThreeWayMergeView.css stylesheet not being imported * Span left field value to 2 columns when left and right field values are the same * Wrap the copy icon inside a button - Updated the selection box UI * Use HAND cursor when hover over FieldValueCell * Move field cells styles to ThreeWayMergeView.css * Update merge toolbox FXML UI * Implement and style HeaderCell * Take row index as an argument in AbstractCell - Created odd and even pseudo classes that will update the background color of the cell when state changes. - Created NO_ROW_INDEX to be used by HeaderCell, because HeaderCell doesn't base its background color on its row position which is 0. * Color cell background based on its row position (odd or even) * Bind textArea.textProperty() and textProperty() using BindingsHelper * Copy field value to Clipboard user clicks on the copy button - Renamed copy-icon style class - Used ActionFactory for creating the copy icon button * Implement a more complete HeaderView - Created ColumnConstraints that matches the field grid constraints, so when the window is resized grid and header resize equally * Pass left and right headers to HeaderView * Create merged entry * Add the entry type field at the top of the fields list - Sorted fields by name - Removed internal fields * Display entry type and bind merged entry * Minor changes * Style CSS * Update ThreeWayMergeToolbox.fxml * Remove MergeEntries from MergeEntriesDialog * Create EmptyCell for optimization - When cell is empty there is no point of creating a label object * Update HeaderCell * Rename HeaderView to ThreeWayMergeHeaderView * Add buttons to accept all left or right entry changes to ThreeWayMergeToolbar * Disable right field cell when it's not visible * Listen for select all left/right toolbar buttons * Style stuff * Add DiffHighlighter - Implemented UnifiedDiffHighlighter * Create DiffHighlighter.css * Add left padding to HeaderCell * Move diff highlighting styles to Dark.css - Just for testing * Show differences between left and right values using a unified diff view - Just for testing * Change MergeEntriesDialog stage style * Remove BackgroundTone from AbstractCell * Move CopyFieldValueCommand * Make DiffMethod public * Move CopyFieldValueCommand * Implement SplitDiffHighlighter * Show diffs when user selects "Show Diff" in the toolbar UI - Only unified diff view will be shown for now * Fix bugs in UnifiedDiffHighlighter * Style css stuff * Fix typos * Refactor SplitDiffHighlighter and fix bugs - Added "updated" style class for styling CHANGE diffs * Remove redundant constructor from UnifiedDiffHighlighter * Allow users to switch between split and unified diff view - Fixed some bugs * Set left and right headers in MergeEntriesDialog * Refactor ThreeWayMergeHeaderView * Remove wellbehavedfx module dependency * Delete EmptyCell.java - I might recreate it later, but for now, I'm choosing simplicity over performance * Refactor FieldValueCell * Use the new merge UI in DuplicateResolverDialog * Expose an API to change diff view and highlight method from outside the merge toolbar * Use the new merge UI when an entry is changed from external * Minor styling * Remove DiffHighlighter.css stylesheet - You can find diff styles in Base.css and Dark.css * Remove unused dependencies * Allow selecting empty field values * Fix readme :( * Use a theme color for selection box background * Refactor FieldValueCell * Add an action to FieldValueCell for opening Urls * Add the ability to open DOI identifier * Cleanup * Checkstyle * Improve URL validation logic * Use DiffMethod in merge toolbar for consistency * i18n * Cleanup css * Remove redundant icon style * Rename style class field-value to merge-field-value - Since it is used in Base.css and Dark.css, it is critical to distinguish the field cell used is related to the merge UI. * Remove old Merge entries UI * Fix missing header styles * i18n * Garbage collect right cell when it's invisible - When both the left and right cells have the same value, only the left value is displayed, making it unnecessary to keep allocating memory for the right cell. * Fix typo Co-authored-by: Siedlerchr <siedlerkiller@gmail.com>
- Loading branch information