View Javadoc

1   /*
2    WSMO Studio - a Semantic Web Service Editor
3    Copyright (c) 2004-2008, Ontotext Lab. / SIRMA Group
4    
5    This library is free software; you can redistribute it and/or modify it under
6    the terms of the GNU Lesser General Public License as published by the Free
7    Software Foundation; either version 2.1 of the License, or (at your option)
8    any later version.
9    This library is distributed in the hope that it will be useful, but WITHOUT
10   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11   FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12   details.
13   You should have received a copy of the GNU Lesser General Public License along
14   with this library; if not, write to the Free Software Foundation, Inc.,
15   59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16   */
17  
18  /***
19   * <p>Title: WSMO Studio</p>
20   * <p>Description: Semantic Web Service Editor</p>
21   * <p>Copyright:  Copyright (c) 2004-2008</p>
22   * <p>Company: Ontotext Lab. / SIRMA </p>
23   */
24  
25  package org.wsmostudio.bpmo.ui.editor;
26  
27  import org.eclipse.gef.ui.actions.*;
28  import org.eclipse.jface.action.IToolBarManager;
29  import org.eclipse.jface.action.Separator;
30  import org.eclipse.ui.actions.ActionFactory;
31  import org.eclipse.ui.actions.RetargetAction;
32  import org.wsmostudio.bpmo.ui.actions.*;
33  
34  public class ToolbarContributor extends ActionBarContributor
35  {
36  	
37  	@Override
38  	protected void buildActions() {
39  		addRetargetAction(new UndoRetargetAction());
40  		addRetargetAction(new RedoRetargetAction());
41  		addRetargetAction(new DeleteRetargetAction());
42  		addRetargetAction(new ZoomInRetargetAction());
43  		addRetargetAction(new ZoomOutRetargetAction());
44  
45          addRetargetAction(new ExportImageRetargetAction());
46          addRetargetAction(new LayoutRetargetAction());
47          
48          for (RetargetAction extAction : BpmoActionRegistry.getRegistry().listRetargetActions()) {
49              addRetargetAction(extAction);
50          }
51      }
52  	
53  	@Override
54  	protected void declareGlobalActionKeys() {
55  	//	// Nothing to declare.
56  	}
57  
58  	@Override
59  	public void contributeToToolBar(IToolBarManager toolBarManager) {
60  		ActionRegistry reg = getActionRegistry();
61  		toolBarManager.add(reg.getAction(ActionFactory.DELETE.getId()));
62  		toolBarManager.add(reg.getAction(ActionFactory.UNDO.getId()));
63  		toolBarManager.add(reg.getAction(ActionFactory.REDO.getId()));
64  		toolBarManager.add(new Separator());
65  		toolBarManager.add(reg.getAction(GEFActionConstants.ZOOM_IN));
66  		toolBarManager.add(reg.getAction(GEFActionConstants.ZOOM_OUT));
67  		toolBarManager.add(new ZoomComboContributionItem(getPage()));
68  
69          toolBarManager.add(new Separator());
70          toolBarManager.add(reg.getAction(ExportImageAction.ID));
71          toolBarManager.add(reg.getAction(LayoutAction.ID));
72  
73          toolBarManager.add(new Separator());
74          
75          for (RetargetAction extAction : BpmoActionRegistry.getRegistry().listRetargetActions()) {
76              toolBarManager.add(extAction);
77          }
78  
79  	}
80  }
81  
82  /*
83   * $Log$
84   * Revision 1.5  2007/08/01 15:14:15  alex_simov
85   * bpmo modeler works only with wsml files as inputs/outputs. No bpmo export
86   * and java binary serialisation any more.
87   *
88   * Revision 1.4  2007/07/17 14:54:37  alex_simov
89   * export diagram to JPEG and BMP added
90   *
91   * Revision 1.3  2007/06/27 10:46:45  alex_simov
92   * no message
93   *
94   * Revision 1.2  2007/06/26 17:44:31  alex_simov
95   * integrated composer
96   *
97   * Revision 1.1  2007/03/20 10:05:47  alex_simov
98   * SBP modeller initial version
99   *
100  */