Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » MenuManager in TableViewer does not work on mobile device(MenuManager, TableViewer, right click, menu, mobile, tablet, windows)
MenuManager in TableViewer does not work on mobile device [message #1703108] Tue, 28 July 2015 15:03 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 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);


Any idea what may be wrong ?

cheers,
Pawel
Re: MenuManager in TableViewer does not work on mobile device [message #1703140 is a reply to message #1703108] Tue, 28 July 2015 20:24 Go to previous messageGo to next message
Eclipse UserFriend
You should post this to the SWT forum. I'm assuming your tap-and-hold works in other applications?
Re: MenuManager in TableViewer does not work on mobile device [message #1703146 is a reply to message #1703140] Tue, 28 July 2015 21:08 Go to previous message
Pawel Pawel is currently offline Pawel PawelFriend
Messages: 4
Registered: July 2015
Junior Member
Hi

The "tap-and-hold" is not my functionality. It default SWT Table behaviour on tablet. In windows it self it works like that - to use "right click" you have to do "tap-and-hold". It is just the way it works on tablet I do not have any other application to test it, but I have several tables/tableViever in my application for presenting different results/data, and in all of those this problem appears
Previous Topic:Migrating an existing Plugin RCP Product from one server to another
Next Topic:State of the art of migrating RCP apps from 3.x to 4.x as of Mars release (July 2015)?
Goto Forum:
  


Current Time: Fri Apr 26 03:32:03 GMT 2024

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

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

Back to the top