Project

General

Profile

« Previous | Next » 

Revision abc3e4c9

Added by Katja Luther over 6 years ago

ref #7146: avoid classCastException

View differences:

eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/e4/handler/LinkWithTaxonHandlerE4.java
29 29

  
30 30
    @Execute
31 31
    public void execute(@Named(IServiceConstants.ACTIVE_PART)MPart activePart) {
32
        TaxonNavigatorE4 taxonNavigator = (TaxonNavigatorE4) activePart.getObject();
33
        taxonNavigator.setLinkWithTaxon(!taxonNavigator.isLinkWithTaxon());
34
        if(taxonNavigator.isLinkWithTaxon()){
35
            taxonNavigator.updateCurrentTaxon(EventUtility.getTaxonEditor());
36
        }
32
    	if (activePart.getObject() instanceof TaxonNavigatorE4) {
33
	        TaxonNavigatorE4 taxonNavigator = (TaxonNavigatorE4) activePart.getObject();
34
	        taxonNavigator.setLinkWithTaxon(!taxonNavigator.isLinkWithTaxon());
35
	        if(taxonNavigator.isLinkWithTaxon()){
36
	            taxonNavigator.updateCurrentTaxon(EventUtility.getTaxonEditor());
37
	        }
38
    	}
37 39
	}
38 40

  
39 41
    @CanExecute

Also available in: Unified diff