Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 335428 - [OLE] Embedded Excel in OleFrame overides RCP MenuBar all the time.
Summary: [OLE] Embedded Excel in OleFrame overides RCP MenuBar all the time.
Status: CLOSED DUPLICATE of bug 482308
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.6   Edit
Hardware: PC Windows XP
: P3 normal with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: Platform-SWT-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-01-26 04:52 EST by Phil F. CLA
Modified: 2015-12-29 06:59 EST (History)
1 user (show)

See Also:


Attachments
Shows the RCP with the Excel View that has instantly changed the MenuBar. (128.42 KB, image/pjpeg)
2011-01-26 05:01 EST, Phil F. CLA
no flags Details
Shows the ExcelView with incorrect rendering as soon as it gets deactivated. (73.08 KB, image/pjpeg)
2011-01-26 05:06 EST, Phil F. CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Phil F. CLA 2011-01-26 04:52:11 EST
Build Identifier: I20100608-0911

Starting a view that is embedding an Excel instance in an OleFrame is overriding the MenuBar of an RCP instantly until the Excel client gets deactivated. The Excel client is activated using the OLEIVERB_INPLACEACTIVATE. Looking to the Eclipse Corner Article about ActiveX and SWT, as well as Articles of MSDN, using the OLEIVERB_INPLACEACTIVATE should only mix-in the Excel menus as soon as the user clicks on it. Furthermore deactivating the Excel Client leads to improper rendering of it. Clicking outside excel does not hand back the standard RCP MenuBar and has to be forced by deactivating the client. The behaviour does also not change using OLEIVERB_UIACTIVATE or OLEIVERB_SHOW.

The Excel used is an Excel2003. Same behaviour can be reproduced with Word as well.

The view is based on the "plug-in example with a view". The modifiedd oced looks like this:

public class ActiveXTest extends ViewPart {

	private Action action1;
	private Action action2;

	public ActiveXTest() {
	}
	
	OleFrame oleFrame;
	OleControlSite controlSite;
	
	public void createPartControl(Composite parent) {
		oleFrame = new OleFrame(parent , SWT.NONE);	
		controlSite = new OleControlSite(oleFrame, SWT.NONE, "Excel.Sheet");        
        controlSite.doVerb(OLE.OLEIVERB_INPLACEACTIVATE);
		
        makeActions();
        contributeToActionBars();
	}

	
	private void contributeToActionBars() {
		IActionBars bars = getViewSite().getActionBars();
		fillLocalPullDown(bars.getMenuManager());
		fillLocalToolBar(bars.getToolBarManager());
	}

	private void fillLocalPullDown(IMenuManager manager) {
		manager.add(action1);
		manager.add(new Separator());
		manager.add(action2);
	}

	private void fillLocalToolBar(IToolBarManager manager) {
		manager.add(action1);
		manager.add(action2);
	}

	private void makeActions() {
		action1 = new Action() {
			public void run() {
				controlSite.doVerb(OLE.OLEIVERB_INPLACEACTIVATE);
			}
		};
		action1.setText("Activate");
		action1.setToolTipText("Activate");
		action1.setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().
			getImageDescriptor(ISharedImages.IMG_OBJS_INFO_TSK));
		
		action2 = new Action() {
			public void run() {
				controlSite.deactivateInPlaceClient();
			}
		};
		action2.setText("Deactivate");
		action2.setToolTipText("Deactivate");
		action2.setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().
				getImageDescriptor(ISharedImages.IMG_OBJS_INFO_TSK));
		
	}

	public void setFocus() {
		controlSite.setFocus();
	}
}

Reproducible: Always

Steps to Reproduce:
1. Create an example plug-in with a view.
2. Use the code provided in the description.
3. Start the view as Eclipse Aplication.
4. Open the view. The embedded excel will directly change the MenuBar of the RCP.
5. Use the View's action to deactivate the excel. The RCP's MenuBar switches back to normal. But the rendering of Excel fails.
Comment 1 Phil F. CLA 2011-01-26 05:01:14 EST
Created attachment 187619 [details]
Shows the RCP with the Excel View that has instantly changed the MenuBar.

Also switching to another view does not bring back the original RCP MenuBar.
Comment 2 Phil F. CLA 2011-01-26 05:06:27 EST
Created attachment 187621 [details]
Shows the ExcelView with incorrect rendering as soon as it gets deactivated.

Deactivating the Excel in the View is bringing back the RCP MenuBar but show incorrect rendering of Excel.
Comment 3 Szymon Ptaszkiewicz CLA 2015-12-29 06:59:35 EST
The problem with menu is handled in bug 482308.

*** This bug has been marked as a duplicate of bug 482308 ***