import org.eclipse.e4.ui.services.IServiceConstants;
import org.eclipse.e4.ui.workbench.modeling.EPartService;
import org.eclipse.e4.ui.workbench.modeling.ESelectionService;
-import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.StructuredSelection;
protected Object previousSelection;
- public Object getPreviousSelection() {
- return previousSelection;
- }
-
- public void setPreviousSelection(Object previousSelection) {
- this.previousSelection = previousSelection;
- }
-
protected ISelectionChangedListener selectionChangedListener;
public ISelectionChangedListener getSelectionChangedListener() {
showEmptyPage();
return;
}
+ // no active editor found
if(activePart==thisPart && WorkbenchUtility.getActiveEditorPart(partService)==null){
showEmptyPage();
return;
}
- if(previousSelection!=null){
- if(previousSelection==selection || previousSelection.equals(selection)){
- return;
- }
- else if(previousSelection instanceof ISelection &&
- previousSelection.equals(selection)){//skip redundant rendering of details view
- return;
- }
+ if((previousSelection!=null && selection!=null) &&
+ (previousSelection==selection
+ || previousSelection.equals(selection)
+ || new StructuredSelection(selection).equals(previousSelection))
+ ){
+ return;
}
if(delaySelection==null){
delaySelection = new DelaySelection(selection, activePart, thisPart);