Skip to main content



      Home
Home » Newcomers » Newcomers » Java programming question: Viewing .DOC files in Eclipse
Java programming question: Viewing .DOC files in Eclipse [message #153954] Wed, 24 May 2006 20:39 Go to next message
Eclipse UserFriend
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 Go to previous message
Eclipse UserFriend
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.
>
>
Previous Topic:Creating a wizard
Next Topic:eclipse gridlayout frustration
Goto Forum:
  


Current Time: Tue Jul 22 13:59:25 EDT 2025

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

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

Back to the top