Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Nebula » Grid - double click on column header
Grid - double click on column header [message #58019] Mon, 18 August 2008 07:08 Go to next message
Jacek Kolodziejczyk is currently offline Jacek KolodziejczykFriend
Messages: 37
Registered: July 2009
Member
Hello,

In my application a double click on a grid column header should open a
dialog. If I do this

grid.addMouseListener(new MouseAdapter() {
public void mouseDoubleClick(MouseEvent e) {
if (e.y < grid.getHeaderHeight()) {
// open dialog
}
}
});

then the dialog gets open also when I double click the column header
divider to auto size the column, which should not happen.

My current work around was to:

1) change the grid source file to have access to hoveringOnColumnResizer
private member, so in my client code I could do

grid.addMouseListener(new MouseAdapter() {
public void mouseDoubleClick(MouseEvent e) {
if (e.y < grid.getHeaderHeight()
&& !grid.hoveringOnColumnResizer)
{
// open dialog
}
}
});

2) change the beginning of grid.onMouseDoubleClick(MouseEvent e) method
like this

if (hoveringOnColumnResizer)
{
int dw = columnBeingResized.getWidth(); // added
columnBeingResized.pack();
dw -= columnBeingResized.getWidth(); // added
resizingColumn = false;
handleHoverOnColumnResizer(e.x-dw, e.y); // modified
return;
}

My question: is there a simpler way to achieve this and if not could we
have it implemented in the mainstream version?

Cheers
Jacek
Re: Grid - double click on column header [message #58045 is a reply to message #58019] Mon, 18 August 2008 07:52 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 5487
Registered: July 2009
Senior Member
Hi,

No not yet :-(. In my current fork I have also had this problem in my
current project where I forked the grid and what I did was to adjust the
grids mouse handlers to use the addListener()-API and customize the
detail field of the event object (holding all the booleans used internally).

Could you please file a bug report and we can discuss there how we can
achieve better event support?

Tom

Jacek Kolodziejczyk schrieb:
> Hello,
>
> In my application a double click on a grid column header should open a
> dialog. If I do this
>
> grid.addMouseListener(new MouseAdapter() {
> public void mouseDoubleClick(MouseEvent e) {
> if (e.y < grid.getHeaderHeight()) {
> // open dialog
> }
> }
> });
>
> then the dialog gets open also when I double click the column header
> divider to auto size the column, which should not happen.
>
> My current work around was to:
>
> 1) change the grid source file to have access to hoveringOnColumnResizer
> private member, so in my client code I could do
>
> grid.addMouseListener(new MouseAdapter() {
> public void mouseDoubleClick(MouseEvent e) {
> if (e.y < grid.getHeaderHeight()
> && !grid.hoveringOnColumnResizer)
> {
> // open dialog
> }
> }
> });
>
> 2) change the beginning of grid.onMouseDoubleClick(MouseEvent e) method
> like this
>
> if (hoveringOnColumnResizer)
> {
> int dw = columnBeingResized.getWidth(); // added
> columnBeingResized.pack();
> dw -= columnBeingResized.getWidth(); // added
> resizingColumn = false;
> handleHoverOnColumnResizer(e.x-dw, e.y); // modified
> return;
> }
>
> My question: is there a simpler way to achieve this and if not could we
> have it implemented in the mainstream version?
>
> Cheers
> Jacek


--
B e s t S o l u t i o n . at
------------------------------------------------------------ --------
Tom Schindl JFace-Committer
------------------------------------------------------------ --------
Re: Grid - double click on column header [message #58071 is a reply to message #58045] Mon, 18 August 2008 13:06 Go to previous message
Jacek Kolodziejczyk is currently offline Jacek KolodziejczykFriend
Messages: 37
Registered: July 2009
Member
https://bugs.eclipse.org/bugs/show_bug.cgi?id=244422

Tom Schindl wrote:
> Hi,
>
> No not yet :-(. In my current fork I have also had this problem in my
> current project where I forked the grid and what I did was to adjust the
> grids mouse handlers to use the addListener()-API and customize the
> detail field of the event object (holding all the booleans used
> internally).
>
> Could you please file a bug report and we can discuss there how we can
> achieve better event support?
>
> Tom
>
> Jacek Kolodziejczyk schrieb:
>> Hello,
>>
>> In my application a double click on a grid column header should open a
>> dialog. If I do this
>>
>> grid.addMouseListener(new MouseAdapter() {
>> public void mouseDoubleClick(MouseEvent e) {
>> if (e.y < grid.getHeaderHeight()) {
>> // open dialog
>> }
>> }
>> });
>>
>> then the dialog gets open also when I double click the column header
>> divider to auto size the column, which should not happen.
>>
>> My current work around was to:
>>
>> 1) change the grid source file to have access to
>> hoveringOnColumnResizer private member, so in my client code I could do
>>
>> grid.addMouseListener(new MouseAdapter() {
>> public void mouseDoubleClick(MouseEvent e) {
>> if (e.y < grid.getHeaderHeight()
>> && !grid.hoveringOnColumnResizer)
>> {
>> // open dialog
>> }
>> }
>> });
>>
>> 2) change the beginning of grid.onMouseDoubleClick(MouseEvent e)
>> method like this
>>
>> if (hoveringOnColumnResizer)
>> {
>> int dw = columnBeingResized.getWidth(); // added
>> columnBeingResized.pack();
>> dw -= columnBeingResized.getWidth(); // added
>> resizingColumn = false;
>> handleHoverOnColumnResizer(e.x-dw, e.y); // modified
>> return;
>> }
>>
>> My question: is there a simpler way to achieve this and if not could
>> we have it implemented in the mainstream version?
>>
>> Cheers
>> Jacek
>
>
Re: Grid - double click on column header [message #591827 is a reply to message #58019] Mon, 18 August 2008 07:52 Go to previous message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 5487
Registered: July 2009
Senior Member
Hi,

No not yet :-(. In my current fork I have also had this problem in my
current project where I forked the grid and what I did was to adjust the
grids mouse handlers to use the addListener()-API and customize the
detail field of the event object (holding all the booleans used internally).

Could you please file a bug report and we can discuss there how we can
achieve better event support?

Tom

Jacek Kolodziejczyk schrieb:
> Hello,
>
> In my application a double click on a grid column header should open a
> dialog. If I do this
>
> grid.addMouseListener(new MouseAdapter() {
> public void mouseDoubleClick(MouseEvent e) {
> if (e.y < grid.getHeaderHeight()) {
> // open dialog
> }
> }
> });
>
> then the dialog gets open also when I double click the column header
> divider to auto size the column, which should not happen.
>
> My current work around was to:
>
> 1) change the grid source file to have access to hoveringOnColumnResizer
> private member, so in my client code I could do
>
> grid.addMouseListener(new MouseAdapter() {
> public void mouseDoubleClick(MouseEvent e) {
> if (e.y < grid.getHeaderHeight()
> && !grid.hoveringOnColumnResizer)
> {
> // open dialog
> }
> }
> });
>
> 2) change the beginning of grid.onMouseDoubleClick(MouseEvent e) method
> like this
>
> if (hoveringOnColumnResizer)
> {
> int dw = columnBeingResized.getWidth(); // added
> columnBeingResized.pack();
> dw -= columnBeingResized.getWidth(); // added
> resizingColumn = false;
> handleHoverOnColumnResizer(e.x-dw, e.y); // modified
> return;
> }
>
> My question: is there a simpler way to achieve this and if not could we
> have it implemented in the mainstream version?
>
> Cheers
> Jacek


--
B e s t S o l u t i o n . at
------------------------------------------------------------ --------
Tom Schindl JFace-Committer
------------------------------------------------------------ --------
Re: Grid - double click on column header [message #591834 is a reply to message #58045] Mon, 18 August 2008 13:06 Go to previous message
Jacek Kolodziejczyk is currently offline Jacek KolodziejczykFriend
Messages: 37
Registered: July 2009
Member
https://bugs.eclipse.org/bugs/show_bug.cgi?id=244422

Tom Schindl wrote:
> Hi,
>
> No not yet :-(. In my current fork I have also had this problem in my
> current project where I forked the grid and what I did was to adjust the
> grids mouse handlers to use the addListener()-API and customize the
> detail field of the event object (holding all the booleans used
> internally).
>
> Could you please file a bug report and we can discuss there how we can
> achieve better event support?
>
> Tom
>
> Jacek Kolodziejczyk schrieb:
>> Hello,
>>
>> In my application a double click on a grid column header should open a
>> dialog. If I do this
>>
>> grid.addMouseListener(new MouseAdapter() {
>> public void mouseDoubleClick(MouseEvent e) {
>> if (e.y < grid.getHeaderHeight()) {
>> // open dialog
>> }
>> }
>> });
>>
>> then the dialog gets open also when I double click the column header
>> divider to auto size the column, which should not happen.
>>
>> My current work around was to:
>>
>> 1) change the grid source file to have access to
>> hoveringOnColumnResizer private member, so in my client code I could do
>>
>> grid.addMouseListener(new MouseAdapter() {
>> public void mouseDoubleClick(MouseEvent e) {
>> if (e.y < grid.getHeaderHeight()
>> && !grid.hoveringOnColumnResizer)
>> {
>> // open dialog
>> }
>> }
>> });
>>
>> 2) change the beginning of grid.onMouseDoubleClick(MouseEvent e)
>> method like this
>>
>> if (hoveringOnColumnResizer)
>> {
>> int dw = columnBeingResized.getWidth(); // added
>> columnBeingResized.pack();
>> dw -= columnBeingResized.getWidth(); // added
>> resizingColumn = false;
>> handleHoverOnColumnResizer(e.x-dw, e.y); // modified
>> return;
>> }
>>
>> My question: is there a simpler way to achieve this and if not could
>> we have it implemented in the mainstream version?
>>
>> Cheers
>> Jacek
>
>
Previous Topic:Grid - double click on column header
Next Topic:Re: Formatted Date Control
Goto Forum:
  


Current Time: Sun Dec 21 06:56:32 GMT 2014

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

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