1 package org.argosfields;
2
3 import org.argosfields.action.ActionMap;
4 import org.argosfields.action.game.QuitAction;
5 import org.argosfields.action.game.SettingsAction;
6 import org.argosfields.action.server.ConnectAction;
7 import org.argosfields.action.server.DisconnectAction;
8 import org.argosfields.resource.ResourceManager;
9 import org.eclipse.jface.action.Separator;
10 import org.eclipse.jface.action.ToolBarManager;
11 import org.eclipse.swt.SWT;
12
13 /***
14 * DefaultToolBarManager.java
15 * @author Xavier Cho
16 * @version $Revision: 1.1 $ $Date: 2004/04/15 05:43:55 $
17 */
18 public class DefaultToolBarManager extends ToolBarManager {
19 private ActionMap actions;
20
21 public DefaultToolBarManager(final ArgosFields application) {
22 this(application, SWT.FLAT | SWT.WRAP);
23 }
24
25 public DefaultToolBarManager(final ArgosFields application, final int style) {
26 super(style);
27
28 if (application == null) {
29 SWT.error(SWT.ERROR_NULL_ARGUMENT);
30 }
31
32 this.actions = application.getActionMap();
33
34 initialize();
35 }
36
37 protected void initialize() {
38 ResourceManager resources = ResourceManager.getInstance();
39
40 add(actions.get(ConnectAction.class.getName()));
41 add(actions.get(DisconnectAction.class.getName()));
42 add(new Separator());
43 add(actions.get(SettingsAction.class.getName()));
44 add(new Separator());
45 add(actions.get(QuitAction.class.getName()));
46 }
47 }
This page was automatically generated by Maven