Package ch.fusun.baron.basic.client.ui.player

Source Code of ch.fusun.baron.basic.client.ui.player.ProposeMarriageHandler

package ch.fusun.baron.basic.client.ui.player;

import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.swt.SWT;

import ch.fusun.baron.basic.command.ProposeMarriageCommand;
import ch.fusun.baron.client.rmi.ClientService;
import ch.fusun.baron.core.injection.ReInjector;

/**
* Opens the marriage proposal dialog
*/
public class ProposeMarriageHandler extends AbstractHandler {

  @Override
  public Object execute(ExecutionEvent event) throws ExecutionException {
    MarriageProposalDialog dialog = new MarriageProposalDialog();
    if (dialog.open() == SWT.OK) {
      ClientService client = ReInjector.getInstance()
          .getInstanceForClass(ClientService.class);
      client.execute(new ProposeMarriageCommand(dialog.getProposer(),
          dialog.getProposedTo()));
    }
    return null;
  }
}
TOP

Related Classes of ch.fusun.baron.basic.client.ui.player.ProposeMarriageHandler

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.