Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Dynamic Languages Toolkit (DLTK) » Instance DLTK Editor manually
Instance DLTK Editor manually [message #991307] Tue, 18 December 2012 12:50 Go to next message
Rodrigo Antonio is currently offline Rodrigo AntonioFriend
Messages: 17
Registered: June 2010
Location: São Paulo - Brasil
Junior Member
Hello!

I have a problem here.

I made an Editor using the DLTK, it works correctly, however need to instantiate it manually.

I need to instantiate it within the WindowBuilder.

Any idea?

Thank you.
Re: Instance DLTK Editor manually [message #991423 is a reply to message #991307] Wed, 19 December 2012 03:01 Go to previous messageGo to next message
Alex Panchenko is currently offline Alex PanchenkoFriend
Messages: 342
Registered: July 2009
Senior Member
Hi Rodrigo,

Do you mean create the editor inside of some other editor/dialog or what
exactly?

ScriptSourceViewer can be embedded with the code like this:

IDocument document = new Document();
ScriptTextTools tools = uiToolkit.getTextTools();
tools.setupDocumentPartitioner(document);
IPreferenceStore store = uiToolkit.getCombinedPreferenceStore();
ScriptSourceViewer viewer = new ScriptSourceViewer(parent, null, null,
false, SWT.V_SCROLL | SWT.H_SCROLL, store);
ScriptSourceViewerConfiguration configuration =
uiToolkit.createSourceViewerConfiguration();
viewer.configure(configuration);
viewer.setDocument(document);

Control control = viewer.getControl();
GridData data = new GridData(GridData.FILL_BOTH);
control.setLayoutData(data);

Regards,
Alex
Re: Instance DLTK Editor manually [message #991663 is a reply to message #991423] Wed, 19 December 2012 23:59 Go to previous messageGo to next message
Rodrigo Antonio is currently offline Rodrigo AntonioFriend
Messages: 17
Registered: June 2010
Location: São Paulo - Brasil
Junior Member
Hi Alex,

In my plugin which derives from the "Window Builder" I created an editor that derives from MultiPageEditorPart.

In this class I create 3 tabs.

I would put the DLTK editor in the first tab.

I put a TextEditor (org.eclipse.ui.editors.TextEditor) in the first tab, and it works well, however, I would use my DLTK edtior the facilities it offers.

I think my problem with this natures ...

I will test the above source.

Thank you.

Rodrigo
Re: Instance DLTK Editor manually [message #992087 is a reply to message #991663] Thu, 20 December 2012 20:50 Go to previous message
Alex Panchenko is currently offline Alex PanchenkoFriend
Messages: 342
Registered: July 2009
Senior Member
Hi,

As I understand, if you can use TextEditor in the multipageeditor, then
you should also be able to use DLTK based editor, as it extends TextEditor.

What's exactly the problem?

Regards,
Alex
Previous Topic:Want to get ruby working in Eclipse for the first time? (DLTK 2.0)
Next Topic:Blank console window after running Ruby code
Goto Forum:
  


Current Time: Mon Oct 14 03:21:05 GMT 2024

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

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

Back to the top