Syntax Highligting in org.eclipse.swt.widgets.Text [message #633063] |
Fri, 15 October 2010 05:01  |
Eclipse User |
|
|
|
Hi,
I am working on eclipse plugin Development, I have a text area of type org.eclipse.swt.widgets.Text I want code highligting in that text area when a user type some thing. can any body suggest me how can I do it? waiting for you replies.
Jaguar
|
|
|
|
|
Re: Syntax Highligting in org.eclipse.swt.widgets.Text [message #633354 is a reply to message #633343] |
Sat, 16 October 2010 15:57   |
Eclipse User |
|
|
|
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);
|
|
|
Re: Syntax Highligting in org.eclipse.swt.widgets.Text [message #633399 is a reply to message #633354] |
Sun, 17 October 2010 09:06  |
Eclipse User |
|
|
|
Hi Parasad,
Thank you very much for helping me. one more thing to ask if you can guide me. is there any way to use parser for text entered in Styled text box. because in whole of the eclipse community they first save file and then parse it. is there any way I can take the entered Text and parse it?
/Jaguar
|
|
|
Powered by
FUDForum. Page generated in 0.55039 seconds