Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » doubleclick listener disposal?
doubleclick listener disposal? [message #323882] Thu, 10 January 2008 18:46
Eclipse UserFriend
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: Thu May 08 13:46:09 EDT 2025

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

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

Back to the top