Questions tagged [styledtext]

The StyledText widget is a customizable widget that can be used to display and edit text with different colors and font styles.

A StyledText is an editable user interface object that displays lines of text. The following style attributes can be defined for the text.

  • foreground color
  • background color
  • font style (bold, italic, bold-italic, regular)
  • underline
  • strikeout

Related Links:

69 questions
11
votes
1 answer

Most efficient data structure to add styles to text

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…
Aaron Digulla
  • 297,790
  • 101
  • 558
  • 777
10
votes
1 answer

Java Swing Text Editor

Possible Duplicate: What components should I use for building a Java WYSIWYG HTML editor I'm a total newbie in Java programming. I have to do text editor in Swing/AWT and I have one question about it. How can I edit one selected word, for example…
Paweł Reszka
  • 1,507
  • 4
  • 18
  • 41
9
votes
1 answer

How to prevent new line in StyledText after Enter pressed

I need to prevent TextViewer making new lines after I press Enter key in case of preventNewLines flag is enabled. I have this piece of code: TextViewer myTextViewer = new TextViewer (myGroup, SWT.V_SCROLL …
uniquepito
  • 753
  • 2
  • 7
  • 15
9
votes
5 answers

Java SWT show Line numbers for StyledText

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.
kon
  • 2,736
  • 3
  • 23
  • 32
8
votes
6 answers

Changing the colour of text in drawstring()

I'm trying to add emphasis to one work in a string im drawing using swing. I was advised to use HTML with the following code: Graphics2D g2 = (Graphics2D) g; g.drawString("this is something I want people to

NOTICE

", x, y); I…
Chris Headleand
  • 5,003
  • 15
  • 44
  • 63
5
votes
1 answer

How can I save the contents of an SWT StyledText widget as HTML?

Is there an easy way to take the contents of an SWT StyledText widget and save it as HTML, and then conversely take back the saved HTML to load it into the StyledText?
Jean-Philippe Pellet
  • 56,205
  • 18
  • 161
  • 223
4
votes
1 answer

How to break styled text into pages in Android?

I have a long text which I want to break into multiple pages. Also I need a way to style this text.
mixel
  • 22,724
  • 10
  • 111
  • 154
3
votes
2 answers

Getting SWT StyledText widget to always scroll to its end

How do I get a SWT StyledText widget to always stay scrolled to the end it even as new lines of text gets appended to it? I tried to look for some functions that could allow me to set the scroll position but I can't find any. There isn't a property…
Carven
  • 12,832
  • 24
  • 97
  • 139
3
votes
2 answers

Does SWT StyledText have a height limit?

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…
Andrew
  • 83
  • 7
3
votes
1 answer

SWT StyledText - Table with MeasureItem listener jumps to top

I have a StyledText widget with embedded Table controls. However, once I add a MeasureItem listener to adjust the size of the table cells, the table appears at the top of the StyledText widget the first time I scroll, remaining there until I scroll…
Rini
  • 254
  • 1
  • 10
2
votes
1 answer

Java SWT TreeViewer with one column that needs to be StyledText

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" -…
Oren Sarid
  • 143
  • 1
  • 12
2
votes
3 answers

How to get coloured Output on the Log file in java?

I want to write a message in red colour on the log file in java using logger.debug method,is there any way to do it?
user3089783
  • 81
  • 1
  • 2
  • 4
2
votes
1 answer

Looking for an example of a complex text editor using SWT's StyledText

I need to write a text editor which can merge arbitrary text styles from several sources (in my case: spell checker, style hints like repeated words, links and other markup) using SWT StyledText. I examined the the standard ways to do it: I could…
Aaron Digulla
  • 297,790
  • 101
  • 558
  • 777
2
votes
1 answer

SWT Bullet Change Entire Background

I'm trying to highlight the bullet background of the currently active line but if I just set the background color of the bullet it only highlights the number portion. I would like all the space occupied by the bullet to highlighted. I would like…
EmbMicro
  • 1,103
  • 1
  • 12
  • 25
2
votes
1 answer

Inserting Text at Caret Position with StyledText using SWT

How can I insert text at the caret position of a StyledText in SWT? An example of what I mean is as follows: I have a StyledText with "Hello, world!", in. The caret position is in between the space and w, like so (the vertical bar/pipe, "|", is my…
Nathan
  • 778
  • 4
  • 13
1
2 3 4 5