Skip to content

Conversation

@EnzoHirotani
Copy link

Closes #14352

Adds the functionality to delete manually added BST files from the Customization dialog. When a user right-clicks on a manually imported BST file used for entry preview, a "Delete" option now appears in the context menu, allowing easy removal.

Steps to test

  • Open JabRef and click "File" in the top-left corner.
  • Click "Preferences".
  • Select the "Entry Preview" option.
  • Add a custom .bst file (using the "Add/Import" functionality within the Entry Preview settings).
  • Locate the newly added file in the list/search area.
  • Right-click on the added file.
  • Verify that the "Delete" option appears in the context menu and click it.
  • Confirm that the file is successfully removed from the list of custom BST styles.

Mandatory checks

dialogService.showFileOpenDialog(fileDialogConfiguration).ifPresent(bstFile -> viewModel.addBstStyle(bstFile));
}

@SuppressWarnings("unused")
Copy link
Member

Choose a reason for hiding this comment

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

Why this? This is too global?!


## [Unreleased]

- We added a right-click "Delete" option for custom BST styles in the Entry Preview settings, allowing users to easily remove imported styles. [#14352](https://github.com/JabRef/jabref/issues/14352)
Copy link
Member

Choose a reason for hiding this comment

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

Why not following keep-a-changelog format?

Comment on lines -155 to +158
availableListView.selectionModelProperty().getValue().selectedItemProperty().addListener((observable, oldValue, newValue) ->
availableListView.selectionModelProperty().getValue().selectedItemProperty().addListener((_observable, _oldValue, newValue) ->
Copy link
Member

Choose a reason for hiding this comment

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

???????????????

}

public void removeBstStyle(PreviewLayout layout) {
if (!(layout instanceof BstPreviewLayout bstLayout)) {
Copy link
Member

Choose a reason for hiding this comment

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

no assignment to variable needed.

Why isn't the method parameter dirctly BstPreviewLayout?

public void addBstStyle(Path bstFile) {
BstPreviewLayout bstPreviewLayout = new BstPreviewLayout(bstFile);
bstStylesPaths.add(bstFile);
manuallyAddedBstPaths.add(bstFile); // Mark as manually added
Copy link
Member

Choose a reason for hiding this comment

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

The comment states the obvious. Talk about the WHY

})
.executeWith(taskExecutor);
bstStylesPaths.clear();
manuallyAddedBstPaths.clear(); // Reset the set of manually added files
Copy link
Member

Choose a reason for hiding this comment

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

The comment states the obvious. Talk about the WHY

setPreviewLayout(chosenSelectionModelProperty.getValue().getSelectedItem());
}

@SuppressWarnings("SameParameterValue")
Copy link
Member

Choose a reason for hiding this comment

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

????

@github-actions github-actions bot added the status: changes-required Pull requests that are not yet complete label Dec 5, 2025
@github-actions github-actions bot removed the status: changes-required Pull requests that are not yet complete label Dec 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add right click option to delete custom bst style for entry preview

2 participants