1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-24 09:25:31 +02:00

[fix] Double click handler does not expand/collapse categories correctly

This commit is contained in:
Uwe Stieber 2007-04-18 10:47:00 +00:00
parent 5e7a992873
commit 548ba43cd3

View file

@ -220,7 +220,21 @@ public class RSENewConnectionWizardSelectionPage extends WizardPage {
});
treeViewer.addDoubleClickListener(new IDoubleClickListener() {
public void doubleClick(DoubleClickEvent event) {
if (canFlipToNextPage()) getWizard().getContainer().showPage(getNextPage());
// Double-click on a connection type is triggering the sub wizard
if (event.getSelection() instanceof IStructuredSelection) {
IStructuredSelection selection = (IStructuredSelection)event.getSelection();
// The tree is single selection, so look for the first element only.
Object element = selection.getFirstElement();
if (element instanceof RSENewConnectionWizardSelectionTreeElement) {
// Double-click on a connection type is triggering the sub wizard
if (canFlipToNextPage()) getWizard().getContainer().showPage(getNextPage());
} else if (event.getViewer() instanceof TreeViewer) {
TreeViewer viewer = (TreeViewer)event.getViewer();
if (viewer.isExpandable(element)) {
viewer.setExpandedState(element, !viewer.getExpandedState(element));
}
}
}
}
});