Project

General

Profile

« Previous | Next » 

Revision dad85080

Added by Andreas Müller over 1 year ago

ref #10186 fix incorrect delaySelection handling for equal previous selection (and remove some debugging)

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/e4/AbstractCdmEditorPart.java
91 91

  
92 92
        @Override
93 93
        public void run() {
94

  
95
            //same as previous selection? => return
96
            if((previousSelection != null && selection != null)
97
                    && (activePart != null && selectionProvidingPart != null
98
                        && activePart.equals(selectionProvidingPart))
99
                    && (previousSelection == selection
100
                         || previousSelection.equals(selection)
101
                         || new StructuredSelection(selection).equals(previousSelection))
102
                     ) {
103
                 isInDelay = false;
104
                 return;
105
            }
106

  
94 107
            try{
95 108
                selectionChanged_internal(selection, activePart, thisPart);
109
            }catch (Exception ex){
110
                logger.error("Error during selectionChanged_internal", ex);
96 111
            }
97 112
            finally{
113
                previousSelection = selection;
98 114
                isInDelay = false;
99 115
            }
100 116
        }
......
168 184
           }
169 185
        }
170 186

  
171
        //same as previous selection? => return
172
        if((previousSelection != null && selection != null)
173
               && (activePart != null && selectionProvidingPart != null
174
                   && activePart.equals(selectionProvidingPart))
175
               && (previousSelection == selection
176
                    || previousSelection.equals(selection)
177
                    || new StructuredSelection(selection).equals(previousSelection))
178
                ) {
179
            return;
180
        }
187
        //set the delay selection which puts the change handling to the end
181 188
        if(delaySelection == null){
182 189
            delaySelection = new DelaySelection(selection, activePart, thisPart);
183 190
        }else{
......
186 193
            delaySelection.setThisPart(thisPart);
187 194
        }
188 195

  
189
        System.out.println("...selection: " + (selection == null? "": selection.toString().substring(0,10)) + "; a: " + (activePart == null? "":activePart.getLabel())+ "; t: " + (thisPart == null? "":thisPart.getLabel()));
190 196
        //as long as the delay thread is running,
191 197
        if(!isInDelay){
192 198
        	isInDelay = true;
193 199
            sync.asyncExec(delaySelection);
194
            previousSelection = selection;
195
        }else{
196
            System.out.println("In delay");
197 200
        }
198 201
    }
199 202

  

Also available in: Unified diff