Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » OLE integration
OLE integration [message #466758] Tue, 17 January 2006 14:41 Go to next message
Christian Gesswagner is currently offline Christian GesswagnerFriend
Messages: 34
Registered: July 2009
Member
Hi everybody!

I am just using the inplace integration of SWT to open an application
inplace (eg. MS Word).
Because OLE objects does not provide menus like 'File' I build my own 'File'
menu like this:

Menu menuBar = new Menu(shell, SWT.BAR);
getShell().setMenuBar(menuBar);
MenuItem fileItem = new MenuItem(menuBar, SWT.CASCADE);
fileItem.setText("&[File]");

Menu subMenu = new Menu(shell, SWT.DROP_DOWN);
fileItem.setMenu(subMenu);

MenuItem saveItem = new MenuItem(subMenu, SWT.PUSH);
saveItem.setText("Save");

MenuItem closeItem = new MenuItem(subMenu, SWT.PUSH);
closeItem.setText("Close");

oleFrame.setFileMenus(new MenuItem[] { fileItem } );

The OLE object is embedded in an editor and the menubar changes quite well.
But when I am closing the editor the 'File' menu is still visible (the
others like 'Edit', 'Help')
are not visible anymore. But the visible 'File' menu overrides the standard
menubar of my
RCP application although the editor was closed.

Thanks for help!
Christian
Re: OLE integration [message #466813 is a reply to message #466758] Tue, 17 January 2006 20:56 Go to previous messageGo to next message
Veronika Irvine is currently offline Veronika IrvineFriend
Messages: 1272
Registered: July 2009
Senior Member
The idea behind oleFrame.setFileMenus(new MenuItem[] { fileItem } ) is to
merge the applications file menu with the menus specific to OLE. The File
menu is the same one that is present when the OLE document is not active.
As a result, this menu will not be disposed or hidden when the OLE Document
is not active. You should be handing the File menu of the RCP Application
to OleFrame.setFileMenus().

"Christian Gesswagner" <christian.gesswagner@ams-engineering.com> wrote in
message news:dqivme$vaf$1@utils.eclipse.org...
> Hi everybody!
>
> I am just using the inplace integration of SWT to open an application
> inplace (eg. MS Word).
> Because OLE objects does not provide menus like 'File' I build my own
> 'File'
> menu like this:
>
> Menu menuBar = new Menu(shell, SWT.BAR);
> getShell().setMenuBar(menuBar);
> MenuItem fileItem = new MenuItem(menuBar, SWT.CASCADE);
> fileItem.setText("&[File]");
>
> Menu subMenu = new Menu(shell, SWT.DROP_DOWN);
> fileItem.setMenu(subMenu);
>
> MenuItem saveItem = new MenuItem(subMenu, SWT.PUSH);
> saveItem.setText("Save");
>
> MenuItem closeItem = new MenuItem(subMenu, SWT.PUSH);
> closeItem.setText("Close");
>
> oleFrame.setFileMenus(new MenuItem[] { fileItem } );
>
> The OLE object is embedded in an editor and the menubar changes quite
> well.
> But when I am closing the editor the 'File' menu is still visible (the
> others like 'Edit', 'Help')
> are not visible anymore. But the visible 'File' menu overrides the
> standard
> menubar of my
> RCP application although the editor was closed.
>
> Thanks for help!
> Christian
>
>
Re: OLE integration [message #466847 is a reply to message #466813] Wed, 18 January 2006 06:38 Go to previous messageGo to next message
Christian Gesswagner is currently offline Christian GesswagnerFriend
Messages: 34
Registered: July 2009
Member
=============
You should be handing the File menu of the RCP Application to
OleFrame.setFileMenus().
=============
I can not follow you. Can you explain this sentence in more detail or can
you post some code,
because I am using the method 'oleFrame.setFileMenus(...)' and the static
method 'OleFrame.setFileMenus(...)'
does not exist.

Thank you!
Re: OLE integration [message #466863 is a reply to message #466847] Wed, 18 January 2006 17:02 Go to previous message
Veronika Irvine is currently offline Veronika IrvineFriend
Messages: 1272
Registered: July 2009
Senior Member
I am not referring to a static method. For the method
'oleFrame.setFileMenus()' you should not be creating a special File menu but
rather you should be passing the same File menu that is displayed in your
RPC application when the OLE Document is not active.


"Christian Gesswagner" <christian.gesswagner@ams-engineering.com> wrote in
message news:dqknpd$rh$1@utils.eclipse.org...
> =============
> You should be handing the File menu of the RCP Application to
> OleFrame.setFileMenus().
> =============
> I can not follow you. Can you explain this sentence in more detail or can
> you post some code,
> because I am using the method 'oleFrame.setFileMenus(...)' and the static
> method 'OleFrame.setFileMenus(...)'
> does not exist.
>
> Thank you!
>
>
Previous Topic:Standard key bindings for text fields
Next Topic:How do a add cell editors to my property descriptors
Goto Forum:
  


Current Time: Sun Oct 20 21:57:40 GMT 2019

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

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

Back to the top