Skip to content

Commit e665d7e

Browse files
committed
Allow getting StyledText content as html via getData
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.
1 parent 35119f0 commit e665d7e

File tree

1 file changed

+9
-0
lines changed
  • bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom

1 file changed

+9
-0
lines changed

bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledText.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10935,4 +10935,13 @@ public static void updateAndRefreshCarets(StyledText styledText, Consumer<Caret>
1093510935

1093610936
}
1093710937

10938+
@Override
10939+
public Object getData(String key) {
10940+
if ("StyledText.htmlText".equals(key)) {
10941+
HTMLWriter htmlWriter = new HTMLWriter(this, 0, content.getCharCount(), content);
10942+
return getPlatformDelimitedText(htmlWriter);
10943+
}
10944+
return super.getData(key);
10945+
}
10946+
1093810947
}

0 commit comments

Comments
 (0)