Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsWordPad in SWT application
https://www.eclipse.org/forums/index.php/mv/msg/171267/544595/#msg_544595
I write a editor for templates. The templates are persisted in a database. Format of the templates is rtf. The look of the application: on the left a view with a list of templates, in the middle a editor, on the right (or bottom) a view with a list of placeholders (like ${var}).
The application will run only on Windows, so I want to use Wordpad as editor. I have some questions:
1. How should I embed the Wordpad: with OleClientSite, or OleControlSite?
2. How can I control which toolbars of Wordpad are available and shown in my application?
3. How can I "inject" a placeholder (after doubleclick on row in view with placeholders) in a current position of the cursor in the editor?
4. How can I load and save content of the editor in form of byte[] instead of a file?
Regards,
Jacek]]>Jacek 2010-07-04T16:37:34-00:00Re: WordPad in SWT application
https://www.eclipse.org/forums/index.php/mv/msg/171267/544732/#msg_544732
We've actually had quite a similar problem, that we solved initially by
embedding RichText COM widget, but that turned out to be somewhat messy
distribution wise (you will need to redistribute the VB custom control,
and handle all the registration and cleanup of the weidget in
install/uninstall of the product).
Also we did not have good enough control over the embedded COM widget
(e.g. widget borders, scrollbars and their position and other aspects
that were out of our reach when using OLE).
We ended up writing thin JNI layer to calling platform's native RichEdit
MFC widget directly from java.
This allowed us to gain fairly solid control over the RichEdit widget
(or rather aspects of te widget that we cared about) and removed the
nightmare of managing the redistribution of the VB OLE control library.
4.07.2010 19:37, Jacek kirjutas:
> Hi,
>
> I write a editor for templates. The templates are persisted in a
> database. Format of the templates is rtf. The look of the application:
> on the left a view with a list of templates, in the middle a editor, on
> the right (or bottom) a view with a list of placeholders (like ${var}).
>
> The application will run only on Windows, so I want to use Wordpad as
> editor. I have some questions:
>
> 1. How should I embed the Wordpad: with OleClientSite, or OleControlSite?
> 2. How can I control which toolbars of Wordpad are available and shown
> in my application?
> 3. How can I "inject" a placeholder (after doubleclick on row in view
> with placeholders) in a current position of the cursor in the editor?
> 4. How can I load and save content of the editor in form of byte[]
> instead of a file?
>
> Regards,
> Jacek
--
Roland Tepp]]>Roland Tepp2010-07-05T11:45:47-00:00