Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » TextEditor (sourceViewer) in a view
TextEditor (sourceViewer) in a view [message #333815] Wed, 07 January 2009 10:26 Go to next message
Hugues Rérolle is currently offline Hugues RérolleFriend
Messages: 60
Registered: July 2009
Member
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), furthermore I want to active
drag'n drop.

Thanks in advance,

Hugues
Re: TextEditor (sourceViewer) in a view [message #333817 is a reply to message #333815] Wed, 07 January 2009 11:21 Go to previous messageGo to next message
Dani Megert is currently offline Dani MegertFriend
Messages: 3802
Registered: July 2009
Senior Member
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
> furthermore I want to active drag'n drop.
>
> Thanks in advance,
>
> Hugues
Re: TextEditor (sourceViewer) in a view [message #333818 is a reply to message #333817] Wed, 07 January 2009 14:39 Go to previous message
Hugues Rérolle is currently offline Hugues RérolleFriend
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
Previous Topic:how to dynamically create a instance of a class in eclipse plugin
Next Topic:Tables and Checkboxes
Goto Forum:
  


Current Time: Thu Dec 26 17:18:40 GMT 2024

Powered by FUDForum. Page generated in 0.03957 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top