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

Checkbox support on Markdown preview #6401

Merged
merged 1 commit into from
Sep 22, 2023

Conversation

moacirrf
Copy link
Contributor

@moacirrf moacirrf commented Sep 2, 2023

Added support for Checkbox on Markdown Preview and some other changes that i will explain.
image

Project: Markdown Support

Added a package ui.preview and and ui.preview.views
image

  • MarkdownEditorKit.java : Is reponsible to supply a custom ViewFactory and this class has a very interesting method called getStyleSheet that is important to deal with themes on JEditorPane, so i believe that was better extract to a new class to avoid use of Anonymous class.

  • MarkdownViewFactory : Is responsible to create custom views to JEditorPane, it will receive a Html element and convert to the most similar swing component.

  • ViewUtils.java: Just a utility class to deal with HTML elements.

  • CheckboxView.java: A view of a Checkbox in this example was necessary create a custom just to preserve state checked and fix some border

Project: Markdown Library

Added flexmark-ext-gfm-tasklist to support of checkboxes.

Ps.: I do not have option to add a Label...

@Chris2011
Copy link
Contributor

What label would you like to add?

@moacirrf
Copy link
Contributor Author

moacirrf commented Sep 3, 2023

What label would you like to add?

I believe Editor and dependencies would be good.
Thank you

@Chris2011 Chris2011 added dependencies Pull requests that update a dependency file Editor labels Sep 3, 2023
Copy link
Contributor

@lkishalmi lkishalmi left a comment

Choose a reason for hiding this comment

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

Looks great! Thank you!

@mbien mbien added this to the NB20 milestone Sep 4, 2023
@apache apache locked and limited conversation to collaborators Sep 21, 2023
@apache apache unlocked this conversation Sep 21, 2023
Copy link
Member

@mbien mbien left a comment

Choose a reason for hiding this comment

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

haven't tested it but code looks good to me.

please squash everything to one commit and force push since this PR looks ready to merge.

Markdown Preview

* Support checkbox on preview
* A utils class to handle some Html Elements
* A custom MarkdownEditorKit
* A MarkdownViewFactory to create custom views for preview.
* Update dependecy FlexMark library from 1.14 to 1.15.

Fix public-packages declaration to just use subpackages.

Included flexmark-ext-gfm-tasklist-0.62.2.jar to license file.

Removed non necessary utility class.
@moacirrf
Copy link
Contributor Author

haven't tested it but code looks good to me.

please squash everything to one commit and force push since this PR looks ready to merge.

Done!
thanks

@moacirrf moacirrf closed this Sep 22, 2023
@moacirrf moacirrf reopened this Sep 22, 2023
@mbien mbien merged commit 9afb06a into apache:master Sep 22, 2023
34 checks passed
@mbien
Copy link
Member

mbien commented Sep 22, 2023

@moacirrf congrats to your first contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file Editor Markdown
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants