]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.team.ui/src/org/simantics/team/ui/handlers/GetOutgoingHandler.java
5f84c49aeab3d5fca6ff177864505e1847669d4c
[simantics/platform.git] / bundles / org.simantics.team.ui / src / org / simantics / team / ui / handlers / GetOutgoingHandler.java
1 /*******************************************************************************
2  * Copyright (c) 2007, 2010 Association for Decentralized Information Management
3  * in Industry THTH ry.
4  * All rights reserved. This program and the accompanying materials
5  * are made available under the terms of the Eclipse Public License v1.0
6  * which accompanies this distribution, and is available at
7  * http://www.eclipse.org/legal/epl-v10.html
8  *
9  * Contributors:
10  *     VTT Technical Research Centre of Finland - initial API and implementation
11  *******************************************************************************/
12 package org.simantics.team.ui.handlers;
13
14 import org.eclipse.core.commands.ExecutionEvent;
15 import org.eclipse.core.commands.ExecutionException;
16 import org.eclipse.jface.viewers.ISelection;
17 import org.eclipse.jface.viewers.IStructuredSelection;
18 import org.eclipse.jface.viewers.StructuredSelection;
19 import org.eclipse.ui.handlers.HandlerUtil;
20 import org.simantics.db.Session;
21 import org.simantics.db.service.LifecycleSupport;
22 import org.simantics.db.service.TeamSupport;
23 import org.simantics.team.Activator;
24 import org.simantics.ui.SimanticsUI;
25 import org.simantics.ui.workbench.handler.AbstractPreferenceHandler;
26
27 public class GetOutgoingHandler extends AbstractPreferenceHandler {
28
29         public GetOutgoingHandler() {
30                 super(Activator.getDefault());
31         }
32
33         @Override
34         public Object execute(ExecutionEvent event) throws ExecutionException {
35
36                 ISelection sel = HandlerUtil.getCurrentSelection(event);
37                 IStructuredSelection ss = StructuredSelection.EMPTY;
38                 if (sel instanceof IStructuredSelection)
39                         ss = (IStructuredSelection) sel;
40                 
41         try {
42                 Session session = SimanticsUI.getSession();
43                 TeamSupport ps = session.getService(TeamSupport.class);
44                 LifecycleSupport support = session.getService(LifecycleSupport.class);
45                 System.out.println("koss");
46 //            support.save();
47 //              ps.publish();
48                 } /*catch (InternalException e) {
49                         e.printStackTrace();
50                 }  */finally {
51                 }
52
53                 return null;
54                 
55         }
56
57 }