Package net.sphene.goim.rcp.ui.wizard

Source Code of net.sphene.goim.rcp.ui.wizard.WizardConfigureGames

/*
* File    : WizardConfigureGames.java
* Created : 28.12.2005
* By      : kahless
*
* GOIM - Gamers Own Instant Messenger
* Copyright (C) 2005 Herbert Poul (kahless@sphene.net / 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.rcp.ui.wizard;

import net.sphene.goim.rcp.GOIMPlugin;
import net.sphene.goim.rcp.beans.GOIMGameList;
import net.sphene.goim.rcp.extensionpoints.game.GameUtils;
import net.sphene.goim.rcp.ui.preferences.GOIMPreferenceGameGUI;

import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;

public class WizardConfigureGames extends WizardPage {
  boolean searchedForGames = false;

  public WizardConfigureGames() {
    super("configureGames");
    this.setTitle("Configure Games");
    this.setDescription("Adding your installed Games.");
  }

  public boolean isCurrentPage() { return super.isCurrentPage(); }
  @Override
  public boolean isPageComplete() {
    if(isCurrentPage() && !searchedForGames) {
      GameUtils.autodetectGames(GOIMPlugin.getPreferenceObject(GOIMGameList.class));
      searchedForGames = true;
      setPageComplete(true);
    }
    return super.isPageComplete();
  }

  public void createControl(Composite parent) {
    Composite topLevel = new Composite(parent,SWT.NULL);
    setControl(topLevel);
   
    topLevel.setLayout(new GridLayout(1,true));
   
    Label lblDescr = new Label(topLevel,SWT.WRAP);
    lblDescr.setLayoutData(new GridData(SWT.FILL,SWT.BEGINNING,true,false));
    lblDescr.setText("On this page you need to add all Games you have " +
        "installed so GOIM recognizes them. Most games can be " +
        "automatically detected and should already appear in " +
        "the following list. If Games are missing you need to " +
        "add them by hand.");
    GOIMPreferenceGameGUI gui = new GOIMPreferenceGameGUI(topLevel,SWT.NONE);
    gui.setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,true));
  }
}
TOP

Related Classes of net.sphene.goim.rcp.ui.wizard.WizardConfigureGames

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.