Project

General

Profile

« Previous | Next » 

Revision c4de8fcb

Added by Andreas Müller about 3 years ago

cleanup

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/e4/AbstractCdmEditorPartE4.java
158 158
           }catch(SWTException e){
159 159
              logger.debug("Something went wrong for viewer.getControl().setEnabled(true) in " + this.getClass().getSimpleName(), e);
160 160
           }
161

  
162 161
        }
163 162

  
164
        if((previousSelection!=null && selection!=null) && (activePart != null &&  selectionProvidingPart != null && activePart.equals(selectionProvidingPart)) &&
165
                (previousSelection==selection
166
                || previousSelection.equals(selection)
167
                || new StructuredSelection(selection).equals(previousSelection))
163
        if((previousSelection!=null && selection!=null)
164
               && (activePart != null &&  selectionProvidingPart != null && activePart.equals(selectionProvidingPart))
165
               && (previousSelection==selection
166
                    || previousSelection.equals(selection)
167
                    || new StructuredSelection(selection).equals(previousSelection))
168 168
                ) {
169 169
            return;
170 170
        }
......
214 214
                return;
215 215
            }
216 216
            viewer.getControl().setEnabled(true);
217
            if(selection.getFirstElement()!=null){
217
            if(element != null){
218 218
                if (element instanceof Taxon){
219 219

  
220 220
                    Taxon taxon = HibernateProxyHelper.deproxy(element, Taxon.class);
......
223 223
                        if (node != null){
224 224
                            boolean doEnable = CdmStore.currentAuthentiationHasPermission(node,
225 225
                                    RequiredPermissions.TAXON_EDIT);
226
                             if (!doEnable){
226
                            if (!doEnable){
227 227
                                 //check whether there are explicit TaxonNode rights
228 228
                                 boolean taxonnodePermissionExists = false;
229 229
                                 Collection<? extends GrantedAuthority> authorities = CdmStore.getCurrentAuthentiation().getAuthorities();
......
235 235
                                 if (!taxonnodePermissionExists){
236 236
                                     doEnable = true;
237 237
                                 }
238
                             }
238
                            }
239 239

  
240 240
                            //TODO: differ between the views
241 241
                            this.isEnabled = doEnable;
242 242
                        }
243

  
244

  
245 243
                    }
246 244
                    if (taxon.isMisapplication() || taxon.isProparteSynonym() ){
247 245

  
......
259 257
                                }
260 258
                            }
261 259
                        }
262

  
263

  
264 260
                    }
265 261
                }
262

  
266 263
                //unwrap term DTOs
267 264
                if(element instanceof TermDto){
268 265
                    element = CdmStore.getService(ITermService.class).load(((TermDto) element).getUuid());
......
318 315
                            null,
319 316
                            e,
320 317
                            true);
321

  
322 318
                }
323 319
            }
324

  
325 320
        }
321

  
326 322
        reset();
327 323
        if(thisPart!=null){
328 324
            thisPart.setLabel(getViewName());

Also available in: Unified diff