Java programming question: Viewing .DOC files in Eclipse [message #153954] |
Wed, 24 May 2006 20:39  |
Eclipse User |
|
|
|
Originally posted by: simon_mcmahon.health.qld.gov.au
Hi,
I notice that Eclipse can open a WFW .DOC file and display it within its
application frame.
How would I find the source code within eclipse that does this? I know it
uses the desktop's browser to display HTML. Maybe its using the JDIC?
I assume I can reuse that code from Eclipse in my own projects.
Regards,
Simon.
|
|
|
Re: Java programming question: Viewing .DOC files in Eclipse [message #154033 is a reply to message #153954] |
Thu, 25 May 2006 16:48  |
Eclipse User |
|
|
|
Hi
Good point to start from Platform Documentation: OleFrame.
You could use this this scriplet as an example:
public static void main(String[] args) {
Display display = new Display();
Shell shell = new Shell(display);
shell.setSize (450, 350);
shell.setLayout(new FillLayout());
shell.setText ("Test Shell");
Menu bar = new Menu(shell, SWT.BAR);
shell.setMenuBar(bar);
OleFrame frame = new OleFrame(shell, SWT.NONE);
File file = new File("C:\\mytest.doc");
OleClientSite clientSite = new OleClientSite(frame, SWT.NONE, file);
int i = clientSite.doVerb(OLE.OLEIVERB_INPLACEACTIVATE);
shell.open();
while (!shell.isDisposed()) {
if (!display.readAndDispatch())
display.sleep();
}
display.dispose();
}
best regards
Ram
Simon McMahon wrote:
> Hi,
>
> I notice that Eclipse can open a WFW .DOC file and display it within its
> application frame.
>
> How would I find the source code within eclipse that does this? I know
> it uses the desktop's browser to display HTML. Maybe its using the JDIC?
>
> I assume I can reuse that code from Eclipse in my own projects.
>
> Regards,
>
> Simon.
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.08870 seconds