Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Open excel in eclipse editor?
Open excel in eclipse editor? [message #317643] Wed, 11 July 2007 04:04 Go to next message
Lionel is currently offline LionelFriend
Messages: 31
Registered: July 2009
Member
Hi all,

I am wondering if it is possible to open excel in eclipse. I've associated
xml files with Excel but when I double click a file eclipse launches excel
externally.

Thanks

Lionel.
Re: Open excel in eclipse editor? [message #317652 is a reply to message #317643] Wed, 11 July 2007 11:28 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

There's no default way to do it (i.e. no configuration that you can
tweak to make it happen). But you can create an editors with an
embedded OLE site and then you will get excel embedded in eclipse.

Later,
PW


Re: Open excel in eclipse editor? [message #317655 is a reply to message #317652] Wed, 11 July 2007 12:00 Go to previous messageGo to next message
Dani Megert is currently offline Dani MegertFriend
Messages: 3802
Registered: July 2009
Senior Member
Paul Webster wrote:

> There's no default way to do it (i.e. no configuration that you can
> tweak to make it happen). But you can create an editors with an
> embedded OLE site and then you will get excel embedded in eclipse.

At least on my install OLE works out of the box for Word and Powerpoint
but fails for Excel. Maybe a bug?

Dani

>
> Later,
> PW
Re: Open excel in eclipse editor? [message #317660 is a reply to message #317655] Wed, 11 July 2007 12:55 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

Daniel Megert wrote:
>
> At least on my install OLE works out of the box for Word and Powerpoint
> but fails for Excel. Maybe a bug?

Definitely worth investigating:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=196146

PW


Re: Open excel in eclipse editor? [message #317690 is a reply to message #317652] Wed, 11 July 2007 22:50 Go to previous messageGo to next message
Lionel is currently offline LionelFriend
Messages: 31
Registered: July 2009
Member
I am building a plugin that I want to have excel embedded in. I've got
Excel embedding in a view at the moment, but as I'm fairly new to eclipse
and particularly eclipse plugins, I haven't yet managed to do it in the
editor part of the plugin. It seems incredibly complicated for the editor
but maybe I'm missing the simple solution.

Thanks for the response, at least now I know what I have to do.
Re: Open excel in eclipse editor? [message #317691 is a reply to message #317655] Wed, 11 July 2007 22:52 Go to previous messageGo to next message
Lionel is currently offline LionelFriend
Messages: 31
Registered: July 2009
Member
Daniel Megert wrote:

> Paul Webster wrote:
> At least on my install OLE works out of the box for Word and Powerpoint
> but fails for Excel. Maybe a bug?

What do you mean fails? I embedded Excel but with version 3.2 of swt it
had some bugs. Version 3.3 fixed some of these.
Re: Open excel in eclipse editor? [message #317699 is a reply to message #317652] Thu, 12 July 2007 06:22 Go to previous messageGo to next message
Lionel is currently offline LionelFriend
Messages: 31
Registered: July 2009
Member
Paul Webster wrote:

> But you can create an editors with an
> embedded OLE site and then you will get excel embedded in eclipse.


I'm looking at doing this with my plugin, but the book I'm using by Eric
Clayberg makes creating the editor look incredibly complex. I have managed
to embed Excel in a view, that was easy, I've repeated the same thing for
the editor. I can open a view with:
<code>
IWorkbenchPage page = window.getActivePage();
//Open and active the Favorites view.
try {
page.showView(FavoritesView.ID);
} ...
</code>

Where window is and IWorkbenchWindow in the delegate class for an action.
But I can't see a simple way to open an editor, it seems I need an
IEditorInput which I don't know how to create or get. I just want it to be
simple like it is for the view.

Do you have any suggestions?
Re: Open excel in eclipse editor? [message #317747 is a reply to message #317699] Thu, 12 July 2007 13:14 Go to previous message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

Lionel van den Berg wrote:
>
> Where window is and IWorkbenchWindow in the delegate class for an
> action. But I can't see a simple way to open an editor, it seems I need
> an IEditorInput which I don't know how to create or get. I just want it
> to be simple like it is for the view.
>
>

If you register your editor definition against the extension (xls, say)
then double-clicking in the project explorer or package explorer would
try and open the editor for you.

Programmatically, you are taking an IFile and wrapping it in a
FileEditorInput:

page.openEditor(new FileEditorInput(ifile), "my.embedded.excel.editor");

Later,
PW


Previous Topic:CVS Decoration Problems
Next Topic:JFace Problem / Null Display
Goto Forum:
  


Current Time: Thu Jul 04 21:25:02 GMT 2024

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

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

Back to the top