|
|
Re: TextEditor (sourceViewer) in a view [message #333818 is a reply to message #333817] |
Wed, 07 January 2009 14:39 |
Hugues Rérolle Messages: 60 Registered: July 2009 |
Member |
|
|
Daniel Megert wrote:
> Hugues Rérolle wrote:
>> Hi all,
>>
>> I want to develop a text editor in a view (for editing selected text
>> in workbench).
>>
>> Anyone has a idea to achieve this ?
>>
>> I've used SourceViewer with SourceViewerConfiguration.
>> Only syntax Cloring worked, but I don't know how to active other stuff
>> (contentAssist, contentFormatter, etc),
> You have to provide the formatter and the content assistant in your
> source viewer configuration.
>
> Dani
Thanks Dani,
I've already tried by using JavaSourceViewerConfiguration, but only
syntax coloring worked.
public class TestCodeEditor extends ViewPart {
private SourceViewer viewer;
private IDocument doc;
public TestCodeEditor() {
}
public void createPartControl(Composite parent) {
viewer = new SourceViewer(parent, new VerticalRuler(0), SWT.V_SCROLL
| SWT.MULTI | SWT.H_SCROLL | SWT.BORDER);
doc = new Document();
doc.set("");
viewer.setDocument(doc);
JavaSourceViewerConfiguration javaConf = new
JavaSourceViewerConfiguration
(org.eclipse.jdt.ui.JavaUI.getColorManager(),
org.eclipse.jdt.ui.PreferenceConstants.getPreferenceStore(), null,
null);
viewer.configure(javaConf);
}
Hugues
>> furthermore I want to active drag'n drop.
>>
>> Thanks in advance,
>>
>> Hugues
|
|
|
Powered by
FUDForum. Page generated in 0.04157 seconds