-
Notifications
You must be signed in to change notification settings - Fork 187
Allow getting StyledText content as html via getData #2535
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
Conversation
The key is simply StyledText.getData Let's have this one as hidden "gem" for testing purposes to ease both testing the implementation and may one day it would be worth exposing as proper API.
|
Can you provide more context on this? |
Test Results 118 files ±0 118 suites ±0 11m 27s ⏱️ + 1m 21s For more details on these failures, see this check. Results for commit 0f986e1. ± Comparison against base commit 35119f0. |
|
@BeckerWdf Sure, one can do: styledText.getData("StyledText.htmlText")and will get html formatted text or the StyledText content the same as used for clipboard, e.g. <span style='background-color:#ffffff;padding:0px 0px 0px 0px;'><span style='color:#000000;background-color:#ffffff;font-family:"Noto Sans";font-size:10pt;white-space:pre;'><span style='font-weight:bold;'>test</span></span></span> |
|
And what is this needed for? What's the bigger use case on that? |
|
Export content to html for saving purposes, debugging, enhancing clipboard operations/compatibility and so on development purposes. Html being defacto standard for rendering nowadays gives other opportunities for sure. Do you have concerns? |
|
Failing Windows tests are #2516 |
|
What about making it an official API method |
|
I would rather have a cycle (or two) experimenting with it before exposing as API, IMO if/when it becomes API it needs tests and be sure that everything is properly exported. |
No I don't. I am just curious. I am asking my self where the formatting like |
|
FWIW, get/setData is the way to give access to SWT internals if/when they are either not ready or should not become API for some reason e.g. Line 97 in 35119f0
eclipse.platform.swt/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/TaskBar.java Line 127 in 35119f0
Line 644 in 35119f0
eclipse.platform.swt/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Widget.java Line 2722 in 35119f0
|
It's the "defaults" of styled text when no StyleRange overwrites it - white background, no padding. Whether it makes sense to have them or not, combine some of the spans and etc. are exactly the things which in order to improve we need easier way to test. |
The key is simply StyledText.getData
Let's have this one as hidden "gem" for testing purposes to ease both testing the implementation and may one day it would be worth exposing as proper API.