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:

71 questions
2
votes
0 answers

SWT StyledText object with lots of StyleRange

I have a StytedText object which could potentially host a buffer of tens of megabytes of text and hundreds of thousands of StyleRange. Obviously, this doesn't scale at all. My question is, what's the easiest way to implement an on-demand (sort of)…
Nick
  • 761
  • 1
  • 7
  • 20
1
vote
1 answer

Java StyledText, appending text with different font?

I am new to Java and would like to know how to set the font and font color to be used for the next text to be added to a SWT StyledText box. So for example I have an application that defines "command" and "data" text and each is to be displayed in a…
Chimera
  • 5,884
  • 7
  • 49
  • 81
1
vote
1 answer

PDFBox Layout: Add Line Break to StyledText

I'm using pdfbox-layout and I want to add line breaks to a StyledText Element but can't manage to do it. If a styled text contains a line break "\n", I get the following error message: "StyledText must not contain line breaks, use…
Braunbaer
  • 53
  • 7
1
vote
1 answer

How to show non-printable characters in SWT a text widget

How is it possible to display non-printable characters in an SWT StyledText widget in a way it's done by Swing with an empty square? To replace all occurrences with a symbol via regex in the source string can't be the solution because copy & paste…
NormanC
  • 41
  • 3
1
vote
1 answer

SWT StyledText and Paragraph Spacing

StyledText.setLineSpacing() allows line spacing, where each line (whether wrapped or following a carriage return) is separated from its predecessor. Is there a way to set paragraph spacing, where wrapped lines sit together normally, but a carriage…
Rini
  • 254
  • 1
  • 10
1
vote
2 answers

Java SWT overlapping/multiple StyleRanges

I'm using a StyledText in my project, in it I have lots of texts that can have different styles depending on some events, sometimes these styles can overlap, so a style that represents a yellow background color can be set for an area that already…
thinkereer
  • 117
  • 2
  • 8
1
vote
1 answer

SWT Create Two StyledText That Scroll In Tandem

I have to create two StyledText that scroll in tandem , All I am getting is code for creating same using ScrolledComposites . I have limitation of using StyledText only because, I am using it for other purpose as well. I want to create same thing …
RishiKesh Pathak
  • 2,122
  • 1
  • 18
  • 24
1
vote
2 answers

How to display text with many lines inside a ScrolledComposite?

I have a StyledText widget (SWT) inside a ScrolledComposite that should display the content of a log file. Unfortunately the log file has thousands of lines in it so that I came to the point where the widget cuts off the text after ~ 2200 lines. I…
Raven
  • 2,951
  • 2
  • 26
  • 42
1
vote
1 answer

SWT StyledText: Position caret of the next line to tab width of the previous line

I am developing an (rich) editor based on SWT StyledText. There is one feature that I until now cannot solve it. I want my editor to place the cursor at the tab width as the beginning of the previous line when the user presses Ctrl+u (similar to…
APex
  • 29
  • 5
1
vote
0 answers

Eclipse RCP text editor application with WhitespaceCharacterPainter and ToolbarButton

For an eclipse RCP text editor application, designed to open multiple documents, I have incorporated a toolbar button to show non-printable characters, (i.e. tab, space and CR). To show these characters, I add/remove the jface painter…
J Robes
  • 467
  • 1
  • 6
  • 19
1
vote
2 answers

Java StyledText control with IDocument support

My intention is to code a NASTRAN text editor (plain text editor, eclipse pure E4 RCP application). NASTRAN is an engineering structural analysis application. Simplifying, NASTRAN uses text cards of 8-characters-width per field and up to 10 fields…
J Robes
  • 467
  • 1
  • 6
  • 19
1
vote
1 answer

what is the order of events that SWT styleText monitors?

There are a lot of events that styleText can listen to and handle using _listeners of different kinds. How can I find out which events fired when? For example, key event, line event, paint event, and so forth. Here are the listeners…
Alex
  • 897
  • 1
  • 11
  • 21
1
vote
1 answer

Java SWT - StyledText how to show text using monospaced font

Is there any way to force StyledText widget to show text using monospaced font? It's not a problem of used font - I have tried 'Monospace', 'Courier', 'System', 'Fixedsys' and other monospaced fonts... Normal Text widget shows text with monospaced…
jirinovo
  • 2,105
  • 3
  • 26
  • 37
1
vote
1 answer

StyledText cannot change style with setStyleRanges()

The StyledText widget shows a piece of Java code, and it uses a JavaLineStyler for syntax highlighting. However, I would like to show some tokens as selected using codeViewer.setStyleRanges(sranges); //sranges is an array of StyleRange But looks…
Masud Rahman
  • 1,064
  • 4
  • 14
  • 28
1
vote
0 answers

possible swt StyledText bug on osx

I have a problem with a swt StyledText where a part of the text has to be colored. When using following code on MAC OSX (works fine on windows) there is a problem when i enter multiple sequencial 'f' characters. There is alwso a problem when the 'f'…