Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » no context menu on TableViewer
no context menu on TableViewer [message #120887] Fri, 06 February 2009 14:18 Go to next message
Tom H is currently offline Tom HFriend
Messages: 139
Registered: July 2009
Senior Member
Hi,

I have a table viewer which I have added a menu;

public void createPartControl(final Composite parent) {

Composite contents = new Composite(parent, SWT.NONE);
contents.setLayout(new GridLayout(1, false));
viewer = new TableViewer(contents, SWT.NONE);
Table table = viewer.getTable();
table.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));

viewer.setContentProvider(new SecurityListContentProvider());
SecurityListLabelProvider lp = new SecurityListLabelProvider();

lp.createColumns(viewer);
viewer.setLabelProvider(lp);
//viewer.addDoubleClickListener(this);
table.setLinesVisible(false);
viewer.setInput(getViewSite());

Menu menu = new Menu( table );
MenuItem menuItem = new MenuItem( menu, SWT.NONE );
menuItem.setText( "Menu for Table" );
table.setMenu( menu );
}


However, I don't get any menu popup. My menu is working on the TreeViewer,
and my version of the rap demo has a context menu for a "Table" control -
which is where I took the sample code from.

I found a bug; which looks similar
https://bugs.eclipse.org/bugs/show_bug.cgi?id=187503
But that was closed in 2007 apparently.

I noticed also that right clicking on a list, a TreeViewer or a Table,
causes selection of the item, TreeObject or row etc. however by default
right clicking is not having any selection effect on my TableViewer. Could
that be the problem?

Many Thanks in advance for any help!

Tom
Re: no context menu on TableViewer [message #120896 is a reply to message #120887] Fri, 06 February 2009 14:48 Go to previous messageGo to next message
Ralf Sternberg is currently offline Ralf SternbergFriend
Messages: 1313
Registered: July 2009
Senior Member

Hi Tom,

I cannot reproduce this problem. I added a context menu to the
TableViewer tab in the controls demo (same code as you) and it's working
as expected. I also cannot reproduce that right-clicks do not select items.

Which version of RAP do you use? Which browser?

Regards, Ralf


Tom H wrote:
> Hi,
>
> I have a table viewer which I have added a menu;
>
> public void createPartControl(final Composite parent) {
>
> Composite contents = new Composite(parent, SWT.NONE);
> contents.setLayout(new GridLayout(1, false));
> viewer = new TableViewer(contents, SWT.NONE);
> Table table = viewer.getTable();
> table.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
>
> viewer.setContentProvider(new SecurityListContentProvider());
> SecurityListLabelProvider lp = new SecurityListLabelProvider();
>
> lp.createColumns(viewer);
> viewer.setLabelProvider(lp);
> //viewer.addDoubleClickListener(this);
> table.setLinesVisible(false);
> viewer.setInput(getViewSite());
>
> Menu menu = new Menu( table );
> MenuItem menuItem = new MenuItem( menu, SWT.NONE );
> menuItem.setText( "Menu for Table" );
> table.setMenu( menu );
> }
>
>
> However, I don't get any menu popup. My menu is working on the
> TreeViewer, and my version of the rap demo has a context menu for a
> "Table" control - which is where I took the sample code from.
>
> I found a bug; which looks similar
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=187503
> But that was closed in 2007 apparently.
>
> I noticed also that right clicking on a list, a TreeViewer or a Table,
> causes selection of the item, TreeObject or row etc. however by default
> right clicking is not having any selection effect on my TableViewer.
> Could that be the problem?
>
> Many Thanks in advance for any help!
>
> Tom
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
Re: no context menu on TableViewer [message #120914 is a reply to message #120896] Fri, 06 February 2009 15:05 Go to previous messageGo to next message
Tom H is currently offline Tom HFriend
Messages: 139
Registered: July 2009
Senior Member
Ralf Sternberg wrote:

> Which version of RAP do you use? Which browser?

RAP version 1.2.0.20081223-1131

I am using firefox 3.0.5 on fedora 10

Tom
Re: no context menu on TableViewer [message #120923 is a reply to message #120914] Fri, 06 February 2009 15:22 Go to previous messageGo to next message
Tom H is currently offline Tom HFriend
Messages: 139
Registered: July 2009
Senior Member
Tom H wrote:
> Ralf Sternberg wrote:
>> Which version of RAP do you use? Which browser?
> RAP version 1.2.0.20081223-1131
> I am using firefox 3.0.5 on fedora 10

Hi,

It seems that this problem is possibly browser/OS specific, as it works
fine on firefox 3.0.4 on windowsXP, and ie6 on windowsXP

Tom
Re: no context menu on TableViewer [message #120929 is a reply to message #120923] Fri, 06 February 2009 15:32 Go to previous messageGo to next message
Tom H is currently offline Tom HFriend
Messages: 139
Registered: July 2009
Senior Member
it looks like the TableViewer event handlier never sees any right-click
events in firefox 3.0.5 on fedora.
Re: no context menu on TableViewer [message #120938 is a reply to message #120929] Fri, 06 February 2009 15:43 Go to previous messageGo to next message
Tom H is currently offline Tom HFriend
Messages: 139
Registered: July 2009
Senior Member
Also, I disabled all extensions to make sure it wasn't that.

Tom
Re: no context menu on TableViewer [message #120956 is a reply to message #120929] Fri, 06 February 2009 16:43 Go to previous messageGo to next message
Ralf Sternberg is currently offline Ralf SternbergFriend
Messages: 1313
Registered: July 2009
Senior Member

Tom H wrote:
>
> it looks like the TableViewer event handlier never sees any right-click
> events in firefox 3.0.5 on fedora.

Strange, as it works on FF 3.0.5 on Ubuntu. Sure that it doesn't relate
to some FF preferences? I remember there is one setting to allow
Javascript to override context menus... Could you try to start FF with a
new profile?

Ralf
Re: no context menu on TableViewer [message #120999 is a reply to message #120956] Sun, 08 February 2009 06:32 Go to previous message
Tom H is currently offline Tom HFriend
Messages: 139
Registered: July 2009
Senior Member
Ralf Sternberg wrote:

> Tom H wrote:
>>
>> it looks like the TableViewer event handlier never sees any right-click
>> events in firefox 3.0.5 on fedora.

> Strange, as it works on FF 3.0.5 on Ubuntu. Sure that it doesn't relate
> to some FF preferences? I remember there is one setting to allow
> Javascript to override context menus... Could you try to start FF with a
> new profile?

Hi,

As per;
http://www.vertical-visions.de/2008/04/21/firefox-enable-cus tom-javascript-context-menus/
The dom.event.contextmenu.enabled value is true.

Additionally, the context menus and right click selection are working for
my TreeViewer with the current settings - so I can't see how a general
firefox setting would apply to TableViewer and not TreeViewer.

I'm going to try it on a fedora 10 livecd boot to check whether any of my
own preferences are effecting it.

Tom


> Ralf
Previous Topic:Handle return key as tab key
Next Topic:Browser Widget focus
Goto Forum:
  


Current Time: Fri Dec 03 17:39:55 GMT 2021

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

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

Back to the top