Skip to main content



      Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » MenuManager in TableViewer does not work on mobile device (tablet with Win 8)(MenuManager , TableViewer , tablet, mobile, windows)
MenuManager in TableViewer does not work on mobile device (tablet with Win 8) [message #1703147] Tue, 28 July 2015 17:12 Go to next message
Eclipse UserFriend
Hi

Welcome everybody Smile This is my first post on this forum. I really hope you can help me out with this. It is kind of strange.... Ok, so I am developing RCP/SWT application, and it has to work on mobile device with windows 8 as well (10' tablet with windows Cool. So far so good - everything work pretty nice, except one thing that is really annoying. So I have this table, and user has possibility to use right click menu (context menu) on each row. Problem is that it does not work at all on mobile device. Right click on tablet is actually defined by pressing finger for longer period of time - then after 1 or 2 second menu should appear. Problem is that it does not at all. Funny thing is that when I connect a mouse using USB port to tablet I am able to open this menu Smile - it works completely fine. Menu works also with finger action when I press on empty (e.g. table without any data) I noticed that this issue is related with constructor style option SWT.FULL_FULL_SELECTION that is used for creating table. When I remove it from the constructor, right click works fine but there is not any data (no record is selected), so I can not perform any context menu action. Menu is dynamic, so depending on what data is loaded, the contain of menu changes. Main problem is that method menuAboutToShow is not called at all!. The code looks like that:

	Table table = new Table(parent,  SWT.FULL_SELECTION | SWT.VIRTUAL | SWT.H_SCROLL | SWT.V_SCROLL | SWT.MULTI);
			table.setLinesVisible(true);
			table.setLayout(myTableLayout);
			createColumns(table, layout);
			table.setHeaderVisible(true);
			tableViewer = new TableViewer(table);
			tableViewer.setContentProvider(myContentProvider);
			tableViewer.setLabelProvider(myLabelProvider);
			
			MenuManager contextMenu = new MenuManager();
			contextMenu.setRemoveAllWhenShown(true);
			contextMenu.addMenuListener(new IMenuListener() {

				public void menuAboutToShow(IMenuManager mgr) {
						contextMenu.add(new MyAction(action)); // THIS PLACE IS NEVER CALLED WITH RIGHT FINGER CLICK!
						// dynamic filling context menu engine 
				}

			});
			
			Menu menu = contextMenu.createContextMenu(tableViewer.getControl());
			tableViewer.getControl().setMenu(menu);
			getSite().registerContextMenu(contextMenu, null);



Additional info: this tap-hold functionally is standard equivalent for right click on tablet device with Windows. I did not do any additional implementation for that. I think it should just work. I have several tables in my application and in all of those this problem appears. Any idea what may be wrong ?

cheers,
Pawel

[Updated on: Tue, 28 July 2015 17:13] by Moderator

Re: MenuManager in TableViewer does not work on mobile device (tablet with Win 8) [message #1703203 is a reply to message #1703147] Wed, 29 July 2015 06:42 Go to previous message
Eclipse UserFriend
I have just installed SWT Example on my tablet (from here: https://www.eclipse.org/swt/examples.php#standaloneOutsideEclipse) and this same problem appears on the table example. I think it is general problem/bug. Should I report this as a swt eclipse bug ?
Previous Topic:Is there a way to get Shells by Z-Order?
Next Topic:ascending descending table column in swt
Goto Forum:
  


Current Time: Mon Jul 07 20:11:01 EDT 2025

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

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

Back to the top