|
|
|
Re: Syntax Highligting in org.eclipse.swt.widgets.Text [message #633354 is a reply to message #633343] |
Sat, 16 October 2010 19:57 |
|
You can use any SWT widgets inside the tabbed properties sections. Here is the snippet of the usage of styled text in the properties sections.
@Override
public void createControls(Composite parent,
TabbedPropertySheetPage aTabbedPropertySheetPage) {
super.createControls(parent, aTabbedPropertySheetPage);
Composite composite = new Composite(parent, SWT.NONE);
composite.setLayout(new GridLayout(2, false));
Label label = getWidgetFactory().createLabel(composite, "Text:");
label.setLayoutData(new GridData(SWT.LEFT, SWT.TOP, false, false));
StyledText styledText = new StyledText(composite, SWT.MULTI | SWT.WRAP | SWT.BORDER);
GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, true);
gridData.heightHint = 200;
styledText.setLayoutData(gridData);
styledText.setText("This is a sample text");
StyleRange styleRange = new StyleRange();
styleRange.start = 0;
styleRange.length = 4;
styleRange.fontStyle = SWT.BOLD;
styleRange.foreground = new Color(null, 255, 127, 0);
styledText.setStyleRange(styleRange);
Regards,
Prasad
http://marketplace.eclipse.org/user/9964/listings
|
|
|
|
Powered by
FUDForum. Page generated in 0.03286 seconds