Project

General

Profile

« Previous | Next » 

Revision 3b7513fa

Added by Patrick Plitzner over 5 years ago

ref #6554 Avoid re-rendering of details view for same selection

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/e4/AbstractCdmEditorPartE4.java
23 23
import org.eclipse.e4.ui.services.IServiceConstants;
24 24
import org.eclipse.e4.ui.workbench.modeling.EPartService;
25 25
import org.eclipse.e4.ui.workbench.modeling.ESelectionService;
26
import org.eclipse.jface.viewers.ISelection;
26 27
import org.eclipse.jface.viewers.ISelectionChangedListener;
27 28
import org.eclipse.jface.viewers.IStructuredSelection;
28 29
import org.eclipse.jface.viewers.StructuredSelection;
......
160 161

  
161 162
        }
162 163

  
163
        if(previousSelection==null ||
164
                previousSelection!=selection){//skip redundant rendering of details view
165
            if(delaySelection==null){
166
                delaySelection = new DelaySelection(selection, activePart, thisPart);
164
        if(previousSelection!=null){
165
            if(previousSelection==selection || previousSelection.equals(selection)){
166
                return;
167 167
            }
168
            delaySelection.setSelection(selection);
169
            delaySelection.setActivePart(activePart);
170
            delaySelection.setThisPart(thisPart);
171
            if(!isInDelay){
172
                isInDelay = true;
173
                sync.asyncExec(delaySelection);
174
                previousSelection = selection;
168
            else if(previousSelection instanceof ISelection &&
169
                    previousSelection.equals(selection)){//skip redundant rendering of details view
170
                return;
175 171
            }
176 172
        }
173
        if(delaySelection==null){
174
            delaySelection = new DelaySelection(selection, activePart, thisPart);
175
        }
176
        delaySelection.setSelection(selection);
177
        delaySelection.setActivePart(activePart);
178
        delaySelection.setThisPart(thisPart);
179
        if(!isInDelay){
180
            isInDelay = true;
181
            sync.asyncExec(delaySelection);
182
            previousSelection = selection;
183
        }
177 184
    }
178 185

  
179 186
    /** {@inheritDoc} */

Also available in: Unified diff