Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 21:12 Go to next message
Pawel Pawel is currently offline Pawel PawelFriend
Messages: 4
Registered: July 2015
Junior Member
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 21:13]

Report message to a 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 10:42 Go to previous message
Pawel Pawel is currently offline Pawel PawelFriend
Messages: 4
Registered: July 2015
Junior Member
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: Wed Jan 27 08:21:04 GMT 2021

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

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

Back to the top