View Javadoc
1 package org.argosfields.action.server; 2 3 import org.argosfields.ArgosFields; 4 import org.argosfields.action.BaseAction; 5 import org.argosfields.multi.GameClientAdapter; 6 import org.argosfields.multi.client.GameClient; 7 import org.argosfields.multi.client.IGameClient; 8 import org.argosfields.multi.server.ServerInfo; 9 import org.argosfields.wizard.ConnectionWizard; 10 import org.argosfields.wizard.DefaultWizardDialog; 11 import org.eclipse.jface.wizard.Wizard; 12 import org.eclipse.swt.widgets.Event; 13 import org.eclipse.swt.widgets.Shell; 14 15 /*** 16 * ConnectAction.java 17 * 18 * @author Xavier Cho 19 * @version $Revision: 1.5 $ $Date: 2004/04/17 18:21:02 $ 20 */ 21 public class ConnectAction extends BaseAction { 22 23 public ConnectAction(final ArgosFields application) { 24 super(application); 25 26 IGameClient client = GameClient.getInstance(); 27 client.addGameClientListener(new GameClientAdapter() { 28 29 public void sessionStarted(final ServerInfo info) { 30 setEnabled(false); 31 } 32 33 public void sessionEnded() { 34 setEnabled(true); 35 } 36 }); 37 38 setEnabled(!client.isSessionStarted()); 39 } 40 41 /*** 42 * @see org.eclipse.jface.action.IAction#runWithEvent(org.eclipse.swt.widgets.Event) 43 */ 44 public void runWithEvent(final Event event) { 45 Shell parent = getApplication().getShell(); 46 47 Wizard wizard = new ConnectionWizard(); 48 49 DefaultWizardDialog dialog = new DefaultWizardDialog(parent, wizard); 50 dialog.open(); 51 } 52 }

This page was automatically generated by Maven