styledtext

Java SWT TreeViewer with one column that needs to be StyledText

こ雲淡風輕ζ 提交于 2019-12-21 21:20:05
问题 I have a TreeViewer used in an eclipse plugin that uses a content provider and a label provider that implements all of ( ITableLabelProvider , IFontProvider , IColorProvider ). But I need one of the columns of the table it creates to hold "links" - underlined blue text that when clicked causes some popup to open. I guess what I want to do is cause that single column to hold styled text and not just text, and attach a listener to the items in that column of the tree, but I couldn't figure out

Does SWT StyledText have a height limit?

霸气de小男生 提交于 2019-12-12 13:35:20
问题 I am trying to create an application that contains a StyledText box displayed within a ScrolledComposite. I am having difficulties displaying a large number of lines in my StyledText box (over 2,550 seems to cause issues). The StyledText box must not itself have a scroll bar but must be scrollable via the ScrolledComposite. As there are other items below and above the StyledText that need to be scrollable to and I do not want multiple scroll bars. Hence with large amounts of data I have a

Java SWT show Line numbers for StyledText

独自空忆成欢 提交于 2019-12-08 15:58:12
问题 I was wondering if there is a straightforward way to display line numbers with StyledText text field - even if lines are wrapped. I'm using it in my application and if content gets to big, some line numbers would be nice. Thank you. 回答1: The key is org.eclipse.swt.custom.Bullet . It's basically a symbol (or in our case a number) you can add to the beginning of a line. //text is your StyledText text.addLineStyleListener(new LineStyleListener() { public void lineGetStyle(LineStyleEvent e) { /

Java SWT TreeViewer with one column that needs to be StyledText

╄→гoц情女王★ 提交于 2019-12-04 16:56:43
I have a TreeViewer used in an eclipse plugin that uses a content provider and a label provider that implements all of ( ITableLabelProvider , IFontProvider , IColorProvider ). But I need one of the columns of the table it creates to hold "links" - underlined blue text that when clicked causes some popup to open. I guess what I want to do is cause that single column to hold styled text and not just text, and attach a listener to the items in that column of the tree, but I couldn't figure out how to do it. greg-449 Use a separate label provider for each column using TreeViewerColumn :

Most efficient data structure to add styles to text

寵の児 提交于 2019-12-03 06:13:53
问题 I'm looking for the best data structure to add styles to a text (say in a text editor). The structure should allow the following operations: Quick lookup of all styles at absolute position X Quick insert of text at any position (styles after that position must be moved). Every position of the text must support an arbitrary number of styles (overlapping). I've considered lists/arrays which contain text ranges but they don't allow quick insert without recalculating the positions of all styles

Most efficient data structure to add styles to text

眉间皱痕 提交于 2019-12-02 20:50:32
I'm looking for the best data structure to add styles to a text (say in a text editor). The structure should allow the following operations: Quick lookup of all styles at absolute position X Quick insert of text at any position (styles after that position must be moved). Every position of the text must support an arbitrary number of styles (overlapping). I've considered lists/arrays which contain text ranges but they don't allow quick insert without recalculating the positions of all styles after the insert point. A tree structure with relative offsets supports #2 but the tree will degenerate

How to break styled text into pages in Android?

喜夏-厌秋 提交于 2019-11-26 22:36:26
I have a long text which I want to break into multiple pages. Also I need a way to style this text. UPDATE: I created sample application , that shows how to use PageSplitter. How it works? Example application (Russian) - Cleverum . You need only PageSplitter class. Other code shows you how to use this class. import android.graphics.Typeface; import android.text.SpannableString; import android.text.SpannableStringBuilder; import android.text.TextPaint; import android.text.style.StyleSpan; import java.util.ArrayList; import java.util.List; public class PageSplitter { private final int pageWidth;

How to break styled text into pages in Android?

故事扮演 提交于 2019-11-26 09:46:20
问题 I have a long text which I want to break into multiple pages. Also I need a way to style this text. 回答1: UPDATE: I created sample application, that shows how to use PageSplitter. How it works? Example application (Russian) - Cleverum. You need only PageSplitter class. Other code shows you how to use this class. import android.graphics.Typeface; import android.text.SpannableString; import android.text.SpannableStringBuilder; import android.text.TextPaint; import android.text.style.StyleSpan;