/*
* Gamer's Own Instant Messenger
* Copyright (C) 2005-2006 Herbert Poul (kahless@sphene.net)
* 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;
import net.sphene.goim.rcp.beans.GOIMAccount;
import net.sphene.goim.rcp.beans.GOIMAccountList;
import net.sphene.goim.rcp.ui.wizard.FirstStartWizardDialog;
import org.eclipse.ui.IStartup;
import org.eclipse.ui.PlatformUI;
import org.jivesoftware.smack.packet.Presence;
public class WorkbenchStartUp implements IStartup {
public void earlyStartup() {
System.out.println("earlyStartup");
PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable(){
public void run() {
//PlatformUI.getWorkbench().getActiveWorkbenchWindow()
// for(IViewDescriptor descr : PlatformUI.getWorkbench().getViewRegistry().getViews()) {
// System.out.println("IViewDescriptor: " + descr.getId() + " ... " + descr.getLabel());
// //descr.
// }
GOIMPlugin.getDefault().openRemainingContactLists();
GOIMPlugin.getDefault().openTrayIcon();
//new SuccessfulConfiguration(null).open();
if(GOIMPlugin.getAccountList().size() < 1) {
new FirstStartWizardDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell()).open();
// PreferenceDialog dialog = PreferencesUtil.createPreferenceDialogOn(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), GOIMAccountPreferences.ID, new String[] { GOIMPreferencePage.ID,GOIMAccountPreferences.ID, GOIMGames.ID, Icons.ID }, null);
// dialog.open();
}
}
});
GOIMAccountList accountList = GOIMPlugin.getPreferenceObject(GOIMAccountList.class);
for(GOIMAccount account : accountList) {
if(account.autoConnect)
account.xmpp.connect(Presence.Type.AVAILABLE,Presence.Mode.AVAILABLE);
}
}
}