Project

General

Profile

« Previous | Next » 

Revision ffa3cdff

Added by Patrick Plitzner over 6 years ago

ref #6595 Another fix for "move synonym to another taxon" handler

  • close old editor
  • open new one

View differences:

eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/EditorUtil.java
120 120
        }
121 121

  
122 122
        Collection<MPart> parts = partService.getParts();
123
        MPart part = null;
124 123
        //check if part is already opened
125
        for (MPart mPart : parts) {
126
            if(mPart.getObject() instanceof TaxonNameEditorE4
127
                    && ((TaxonNameEditorE4) mPart.getObject()).getTaxon()!=null
128
                    && ((TaxonNameEditorE4) mPart.getObject()).getTaxon().equals(input.getTaxon())){
129
                part = mPart;
124
        for (MPart part : parts) {
125
            if(part.getObject() instanceof TaxonNameEditorE4
126
                    && ((TaxonNameEditorE4) part.getObject()).getTaxon()!=null
127
                    && ((TaxonNameEditorE4) part.getObject()).getTaxon().equals(input.getTaxon())){
128
                //close part to invoke refresh for new part
129
                partService.hidePart(part);
130 130
                break;
131 131
            }
132 132
        }
133
        if(part==null){
134
            part = partService.createPart(NAME_EDITOR_ID);
135

  
136
            MPartStack editorAreaPartStack = WorkbenchUtility.getEditorAreaPartStack(application, modelService);
137
            if(editorAreaPartStack!=null){
138
                editorAreaPartStack.getChildren().add(part);
139
            }
140
            part = partService.showPart(part, PartState.ACTIVATE);
133
        MPart part = partService.createPart(NAME_EDITOR_ID);
141 134

  
142
            TaxonNameEditorE4 editor = (TaxonNameEditorE4) part.getObject();
143
            editor.init(input);
144
        }
145
        else{
146
            part = partService.showPart(part, PartState.ACTIVATE);
135
        MPartStack editorAreaPartStack = WorkbenchUtility.getEditorAreaPartStack(application, modelService);
136
        if(editorAreaPartStack!=null){
137
            editorAreaPartStack.getChildren().add(part);
147 138
        }
139
        part = partService.showPart(part, PartState.ACTIVATE);
140

  
141
        TaxonNameEditorE4 editor = (TaxonNameEditorE4) part.getObject();
142
        editor.init(input);
148 143
    }
149 144

  
150 145
	/**

Also available in: Unified diff