Project

General

Profile

« Previous | Next » 

Revision 018b80b2

Added by Katja Luther about 5 years ago

ref #7854: improve handling of selection changes in distribution editor

View differences:

eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/e4/DistributionCellSelectionListener.java
15 15
import org.eclipse.nebula.widgets.nattable.data.IRowDataProvider;
16 16
import org.eclipse.nebula.widgets.nattable.extension.e4.selection.E4SelectionListener;
17 17
import org.eclipse.nebula.widgets.nattable.layer.cell.ILayerCell;
18
import org.eclipse.nebula.widgets.nattable.layer.event.CellVisualChangeEvent;
18 19
import org.eclipse.nebula.widgets.nattable.layer.event.ILayerEvent;
19 20
import org.eclipse.nebula.widgets.nattable.selection.SelectionLayer;
20 21
import org.eclipse.nebula.widgets.nattable.selection.event.CellSelectionEvent;
......
53 54
                    if(dataValue!=null){
54 55
                        part.getSelectionService().setSelection(new StructuredSelection(dataValue));
55 56
                        return;
57
                    }else{
58
                        part.getSelectionService().setSelection(new StructuredSelection());
59
                        return;
56 60
                    }
57 61
                }
58 62
            }
......
67 71
                    return;
68 72
                }
69 73
            }
74
        }else if (event instanceof CellVisualChangeEvent){
75
            CellVisualChangeEvent cellSelectionEvent = (CellVisualChangeEvent)event;
76
            int columnPosition = cellSelectionEvent.getColumnPosition();
77
            int rowPosition = cellSelectionEvent.getRowPosition();
78
            if(columnPosition>=part.getEditor().getFirstDataColumnIndex()){
79
                Object dataValue = cellSelectionEvent.getLayer().getDataValueByPosition(columnPosition, rowPosition);
80
                if(dataValue!=null){
81
                    part.getSelectionService().setSelection(new StructuredSelection(dataValue));
82
                    return;
83
                }else{
84
                    part.getSelectionService().setSelection(new StructuredSelection());
85
                    return;
86
                }
87

  
88
            }
70 89
        }
71 90
      //  part.getSelectionService().setSelection(new StructuredSelection());
72 91
    }

Also available in: Unified diff