Package net.sphene.goim.serverbrowser.masterserverprovider

Source Code of net.sphene.goim.serverbrowser.masterserverprovider.DefaultAddMasterServerWizard

/*
* File    : DefaultAddMasterServerWizard.java
* Created : 25.03.2006
* By      : kahless
*
* GOIM - Gamers Own Instant Messenger
* Copyright (C) 2005-2006 Herbert Poul
*              (JabberId: kahless@sphene.net / Email: herbert.poul@gmail.com)
* http://goim.sphene.net
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
*/
package net.sphene.goim.serverbrowser.masterserverprovider;

import net.sphene.goim.serverbrowser.ServerBrowserPlugin;
import net.sphene.goim.serverbrowser.models.MasterServer;
import net.sphene.goim.serverbrowser.models.MasterServerList;

import org.eclipse.jface.wizard.Wizard;

public class DefaultAddMasterServerWizard extends Wizard {
  String protocolId;

  private DefaultAddMasterServerPage defaultAddMasterServerPage;

  public DefaultAddMasterServerWizard(String protocolId) {
    super();
    this.protocolId = protocolId;
    setWindowTitle("Add Master Server");
  }

  @Override
  public void addPages() {
    defaultAddMasterServerPage = new DefaultAddMasterServerPage();
    addPage(defaultAddMasterServerPage);
  }

  @Override
  public boolean performFinish() {
    MasterServerList masterServerList = ServerBrowserPlugin.getPreferenceObject(MasterServerList.class);
    MasterServer masterServer = new MasterServer(protocolId,defaultAddMasterServerPage.txtMasterServerAddress.getText());
    masterServer.name = defaultAddMasterServerPage.txtMasterServerName.getText();
    masterServerList.add(masterServer);
    return true;
  }

}
TOP

Related Classes of net.sphene.goim.serverbrowser.masterserverprovider.DefaultAddMasterServerWizard

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.