Disposing off the GridEditor [message #41902] |
Thu, 25 October 2007 10:55 |
Eclipse User |
|
|
|
Originally posted by: rams1983.yahoo.com
Hi
I am adding a GridEditor to each cell of the Grid whenever that particular
cell is clicked as in the code...
expectedPeaksGrid.addMouseListener(new MouseAdapter()
{
Text textControl;
GridItem item1;
public void mouseDown(MouseEvent r)
{
if (expectedPeaksGrid.getCellSelectionCount() != 0)
{
Point p1 = expectedPeaksGrid.getCellSelection()[0];
gridEditor = new GridEditor(expectedPeaksGrid);
textControl = new Text(expectedPeaksGrid, SWT.NONE);
textControl.setText(" ");
textControl.pack();
gridEditor.grabHorizontal = true;
gridEditor.horizontalAlignment = SWT.FILL;
gridEditor.setEditor(textControl, expectedPeaksGrid
.getItem(p1.y), p1.x);
}
}
});
Now I want this grideditor to be disposed as soon as the focus shifts from
the cell that is being edited..
Can anybody suggest how to accomplish this ..
Thanks
Ramya
|
|
|
|
Re: Disposing off the GridEditor [message #42179 is a reply to message #41934] |
Fri, 26 October 2007 09:41 |
Eclipse User |
|
|
|
Originally posted by: rams1983.yahoo.com
Hi Tom
I am trying to show a context menu when I right click on a particular
cell..
But if I donot dispose off the editor immediately after editing,I am not
getting the context menu. Instead I get the context menu of the editor.
So I thought I should dispose off the cell editor after editing or may be
deactivate the control and then when I click on the cell again , the
control is activated..
Or Is there a way I can get my Context Menu even if the editor is active..
Thanks
Ramya
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03498 seconds