Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » How to add Table column header mouse listener?
How to add Table column header mouse listener? [message #446348] Tue, 23 November 2004 16:32 Go to next message
Bianca Jiang is currently offline Bianca JiangFriend
Messages: 5
Registered: July 2009
Junior Member
I need to add context menus on my table column headers on mouse right
click but wasn't successful. I tried the following but my listener doesn't
get any of the mouse events:

tableColumn.addListener(SWT.MouseUp, myListener);

Any help?

Thanks!
Bianca
Re: How to add Table column header mouse listener? [message #446367 is a reply to message #446348] Tue, 23 November 2004 20:37 Go to previous messageGo to next message
Alejandro Narancio is currently offline Alejandro NarancioFriend
Messages: 40
Registered: July 2009
Member
Hi, you can handle the mouse event with se addSelectionListener method:

TableColumn column = new TableColumn(.......);
column.addSelectionListener(new SelectionListener() {
public void widgetSelected(SelectionEvent e) {
System.out.println("The user press on the header of
the column");
}

public void widgetDefaultSelected(SelectionEvent e) {
}
});

Regards, and i hope it help,


Alejandro

Bianca wrote:

> I need to add context menus on my table column headers on mouse right
> click but wasn't successful. I tried the following but my listener doesn't
> get any of the mouse events:

> tableColumn.addListener(SWT.MouseUp, myListener);

> Any help?

> Thanks!
> Bianca
Re: How to add Table column header mouse listener? [message #446369 is a reply to message #446367] Tue, 23 November 2004 22:38 Go to previous messageGo to next message
Bianca Jiang is currently offline Bianca JiangFriend
Messages: 5
Registered: July 2009
Junior Member
Thanks for the reply. Unfortunately, SelectionListener doesn't work for
mouse right click which should bring up the context menu.

-B

Alejandro Narancio wrote:

> Hi, you can handle the mouse event with se addSelectionListener method:

> TableColumn column = new TableColumn(.......);
> column.addSelectionListener(new SelectionListener() {
> public void widgetSelected(SelectionEvent e) {
> System.out.println("The user press on the header of
> the column");
> }

> public void widgetDefaultSelected(SelectionEvent e) {
> }
> });

> Regards, and i hope it help,


> Alejandro

> Bianca wrote:

>> I need to add context menus on my table column headers on mouse right
>> click but wasn't successful. I tried the following but my listener doesn't
>> get any of the mouse events:

>> tableColumn.addListener(SWT.MouseUp, myListener);

>> Any help?

>> Thanks!
>> Bianca
Re: How to add Table column header mouse listener? [message #446370 is a reply to message #446369] Tue, 23 November 2004 22:37 Go to previous messageGo to next message
Benjamin Pasero is currently offline Benjamin PaseroFriend
Messages: 337
Registered: July 2009
Senior Member
Bianca wrote:
> Thanks for the reply. Unfortunately, SelectionListener doesn't work for
> mouse right click which should bring up the context menu.

Hi Bianca,
are you running SWT on Mac? As far as I know, on Mac no event is fired
when selecting the TableHeader.

Regards,
Ben

>
> -B
>
> Alejandro Narancio wrote:
>
>> Hi, you can handle the mouse event with se addSelectionListener method:
>
>
>> TableColumn column = new TableColumn(.......);
>> column.addSelectionListener(new SelectionListener() {
>> public void widgetSelected(SelectionEvent e) {
>> System.out.println("The user press on the header
>> of the column");
>> }
>
>
>> public void widgetDefaultSelected(SelectionEvent e) {
>> }
>> });
>
>
>> Regards, and i hope it help,
>
>
>
>> Alejandro
>
>
>> Bianca wrote:
>
>
>>> I need to add context menus on my table column headers on mouse
>>> right click but wasn't successful. I tried the following but my
>>> listener doesn't get any of the mouse events:
>
>
>>> tableColumn.addListener(SWT.MouseUp, myListener);
>
>
>>> Any help?
>
>
>>> Thanks!
>>> Bianca
>
>
>
Re: How to add Table column header mouse listener? [message #446372 is a reply to message #446370] Tue, 23 November 2004 22:47 Go to previous messageGo to next message
Bianca Jiang is currently offline Bianca JiangFriend
Messages: 5
Registered: July 2009
Junior Member
no, on wondows xp... can't get any mouse events on column header... any
ideas?

-B

Benjamin Pasero wrote:

> Bianca wrote:
>> Thanks for the reply. Unfortunately, SelectionListener doesn't work for
>> mouse right click which should bring up the context menu.

> Hi Bianca,
> are you running SWT on Mac? As far as I know, on Mac no event is fired
> when selecting the TableHeader.

> Regards,
> Ben

>>
>> -B
>>
>> Alejandro Narancio wrote:
>>
>>> Hi, you can handle the mouse event with se addSelectionListener method:
>>
>>
>>> TableColumn column = new TableColumn(.......);
>>> column.addSelectionListener(new SelectionListener() {
>>> public void widgetSelected(SelectionEvent e) {
>>> System.out.println("The user press on the header
>>> of the column");
>>> }
>>
>>
>>> public void widgetDefaultSelected(SelectionEvent e) {
>>> }
>>> });
>>
>>
>>> Regards, and i hope it help,
>>
>>
>>
>>> Alejandro
>>
>>
>>> Bianca wrote:
>>
>>
>>>> I need to add context menus on my table column headers on mouse
>>>> right click but wasn't successful. I tried the following but my
>>>> listener doesn't get any of the mouse events:
>>
>>
>>>> tableColumn.addListener(SWT.MouseUp, myListener);
>>
>>
>>>> Any help?
>>
>>
>>>> Thanks!
>>>> Bianca
>>
>>
>>
Re: How to add Table column header mouse listener? [message #446385 is a reply to message #446372] Wed, 24 November 2004 09:05 Go to previous messageGo to next message
Benjamin Pasero is currently offline Benjamin PaseroFriend
Messages: 337
Registered: July 2009
Senior Member
Bianca wrote:
> no, on wondows xp... can't get any mouse events on column header...
> any ideas?

Hm, well I am too not able to add a listener that reacts on a
mouse-click performed with the right-mouse button. But a
SelectionListener reacts when the left mouse button is pressed.

Ben

>
> -B
>
> Benjamin Pasero wrote:
>
>> Bianca wrote:
>>
>>> Thanks for the reply. Unfortunately, SelectionListener doesn't work
>>> for mouse right click which should bring up the context menu.
>
>
>> Hi Bianca,
>> are you running SWT on Mac? As far as I know, on Mac no event is fired
>> when selecting the TableHeader.
>
>
>> Regards,
>> Ben
>
>
>>>
>>> -B
>>>
>>> Alejandro Narancio wrote:
>>>
>>>> Hi, you can handle the mouse event with se addSelectionListener method:
>>>
>>>
>>>
>>>> TableColumn column = new TableColumn(.......);
>>>> column.addSelectionListener(new SelectionListener() {
>>>> public void widgetSelected(SelectionEvent e) {
>>>> System.out.println("The user press on the header
>>>> of the column");
>>>> }
>>>
>>>
>>>
>>>> public void widgetDefaultSelected(SelectionEvent e) {
>>>> }
>>>> });
>>>
>>>
>>>
>>>> Regards, and i hope it help,
>>>
>>>
>>>
>>>
>>>> Alejandro
>>>
>>>
>>>
>>>> Bianca wrote:
>>>
>>>
>>>
>>>>> I need to add context menus on my table column headers on mouse
>>>>> right click but wasn't successful. I tried the following but my
>>>>> listener doesn't get any of the mouse events:
>>>
>>>
>>>
>>>>> tableColumn.addListener(SWT.MouseUp, myListener);
>>>
>>>
>>>
>>>>> Any help?
>>>
>>>
>>>
>>>>> Thanks!
>>>>> Bianca
>>>
>>>
>>>
>>>
>
>
Re: How to add Table column header mouse listener? [message #446394 is a reply to message #446348] Wed, 24 November 2004 13:58 Go to previous messageGo to next message
Grant Gayed is currently offline Grant GayedFriend
Messages: 2150
Registered: July 2009
Senior Member
There is a request for this, see
https://bugs.eclipse.org/bugs/show_bug.cgi?id=32322 .

Grant

"Bianca " <bjiang@us.ibm.com> wrote in message
news:cnvoml$ous$1@www.eclipse.org...
> I need to add context menus on my table column headers on mouse right
> click but wasn't successful. I tried the following but my listener doesn't
> get any of the mouse events:
>
> tableColumn.addListener(SWT.MouseUp, myListener);
>
> Any help?
>
> Thanks!
> Bianca
>
Re: How to add Table column header mouse listener? [message #446404 is a reply to message #446394] Wed, 24 November 2004 15:51 Go to previous message
Bianca Jiang is currently offline Bianca JiangFriend
Messages: 5
Registered: July 2009
Junior Member
Great to know. thanks, Grant.

Grant Gayed wrote:

> There is a request for this, see
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=32322 .

> Grant

> "Bianca " <bjiang@us.ibm.com> wrote in message
> news:cnvoml$ous$1@www.eclipse.org...
>> I need to add context menus on my table column headers on mouse right
>> click but wasn't successful. I tried the following but my listener doesn't
>> get any of the mouse events:
>>
>> tableColumn.addListener(SWT.MouseUp, myListener);
>>
>> Any help?
>>
>> Thanks!
>> Bianca
>>
Previous Topic:Which class has Eclipse IDE CTabItem drags and drops
Next Topic:Using TAB to jump from column to column
Goto Forum:
  


Current Time: Fri Apr 26 09:31:53 GMT 2024

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

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

Back to the top