Skip to main content


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 #591816] Mon, 18 August 2008 07:08
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
Previous Topic:SWT Multiple tumb slider
Next Topic:Grid - double click on column header
Goto Forum:
  


Current Time: Tue Mar 19 08:33:34 GMT 2024

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

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

Back to the top