Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[platform-swt-dev] Question about text in a TextViewer

Hi,

My purpose: A view I can input text into it from keyboard. When the 'enter' key is pressed, the text will be sent to a non-UI package which will process the text and send the processed text back to the view. Then the view will show the processed text after the input text. This will be repeated for many times before the view closed. So the view will seems full of text of input and processed one after another.

My method: A view extends ViewPart and a viewer extends TextViewer in the view. I know the console in Eclipse, and its work style seems similar to mine. When it is used to show a run of an application which waits the user input text (args) and output the prcessed text. It also use TextViewer to show the text.

My question: How can I make the output text of the non-UI package in the TextViewer un-editable as well as the former input text from keyboard? After reading the console source code in Eclipse I find the 'handleVerifyEvent(VerifyEvent e)' function which will make the 'e.doit = false', but I am not clear about using it. When I add the function in my viewer it doesn't work. 

Am I trying the right way of realize my purpose? Could you tell me where I can find the similar examples?

Thanks!



Back to the top