Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » doubleclick listener disposal?
doubleclick listener disposal? [message #323882] Thu, 10 January 2008 18:46
Ric Wright is currently offline Ric Wright
Messages: 69
Registered: July 2009
Member
I am relatively new to JFace. I have a simple dialog I created that
subclasses Dialog. The relevant snipper is shown below. It works fine,
but strangely (to me, at least). If I do double-click in the list view,
it WORKS fine, but I can no longer get any mouse events for the
Composite that forms the view I am working on. If I select from the
viewer and simply press the OK button, it's all OK. This seems like a
bug, but perhaps I am missing something?

TIA, Ric

protected Control createDialogArea( Composite parent )
{
Composite composite = (Composite) super.createDialogArea(parent);
List list = new List(composite, SWT.BORDER);

viewer = new ListViewer(list);

viewer.addSelectionChangedListener(new ISelectionChangedListener()
{
public void selectionChanged(SelectionChangedEvent event)
{
IStructuredSelection selection = (IStructuredSelection)
event.getSelection();
currentSelection = selection.getFirstElement().toString();
}
});

viewer.addDoubleClickListener(new IDoubleClickListener()
{
public void doubleClick(DoubleClickEvent event)
{
System.out.println("Double-click!");
okPressed();
}
});

// tell the list viewer the source of the data
viewer.setInput(classes);


Object[] selectedItems = new Object[1];
selectedItems[0] = currentSelection;
IStructuredSelection selection = new
StructuredSelection(selectedItems);
viewer.setSelection(selection, true );

return composite;
}
Previous Topic:Contents of plugin.properties not being parsed at runtime.
Next Topic:Errors on certain resources - Exclude resource from any validation
Goto Forum:
  


Current Time: Sat Jul 26 09:28:01 EDT 2014

Powered by FUDForum. Page generated in 0.04118 seconds