3 * Copyright (C) 2015 EDIT
4 * European Distributed Institute of Taxonomy
5 * http://www.e-taxonomy.eu
7 * The contents of this file are subject to the Mozilla Public License Version 1.1
8 * See LICENSE.TXT at the top of this package for the full license terms.
10 package eu
.etaxonomy
.taxeditor
.handler
;
12 import java
.util
.List
;
14 import org
.eclipse
.core
.commands
.AbstractHandler
;
15 import org
.eclipse
.core
.commands
.ExecutionEvent
;
16 import org
.eclipse
.core
.commands
.ExecutionException
;
17 import org
.eclipse
.core
.commands
.IHandler
;
18 import org
.eclipse
.swt
.SWT
;
20 import eu
.etaxonomy
.cdm
.model
.common
.CdmBase
;
21 import eu
.etaxonomy
.taxeditor
.model
.AbstractUtility
;
22 import eu
.etaxonomy
.taxeditor
.model
.MessagingUtils
;
23 import eu
.etaxonomy
.taxeditor
.session
.ICdmEntitySession
;
24 import eu
.etaxonomy
.taxeditor
.store
.CdmStore
;
25 import eu
.etaxonomy
.taxeditor
.view
.sessions
.InspectSessionsDialog
;
32 public class OpenInspectSessionsHandler
extends AbstractHandler
implements IHandler
{
36 * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
40 public Object
execute(ExecutionEvent event
) throws ExecutionException
{
42 Object principal
= CdmStore
.getCurrentAuthentiation().getPrincipal();
44 ICdmEntitySession activeSession
= CdmStore
.getCurrentSessionManager().getActiveSession();
46 if(activeSession
== null) {
47 MessagingUtils
.warningDialog("No Active Session", this, "Active Session is null");
49 List
<CdmBase
> rootEntities
= activeSession
.getRootEntities();
50 if(rootEntities
== null || rootEntities
.isEmpty()) {
51 MessagingUtils
.warningDialog("No Root Entities", this, "No root entities to inspect");
53 InspectSessionsDialog dialog
= new InspectSessionsDialog(AbstractUtility
.getShell(), SWT
.NONE
);