diff options
author | slewis | 2007-05-02 04:58:23 +0000 |
---|---|---|
committer | slewis | 2007-05-02 04:58:23 +0000 |
commit | 6ec918fda636ec1870471adf8d0fa1ce06845e80 (patch) | |
tree | e3dcd51878b876129f85cae4daf48090c6f4d399 /providers/bundles/org.eclipse.ecf.provider.irc.ui/src/org | |
parent | 69023190f2fb00a58b8becd03f6b2560ba201a95 (diff) | |
download | org.eclipse.ecf-6ec918fda636ec1870471adf8d0fa1ce06845e80.tar.gz org.eclipse.ecf-6ec918fda636ec1870471adf8d0fa1ce06845e80.tar.xz org.eclipse.ecf-6ec918fda636ec1870471adf8d0fa1ce06845e80.zip |
Simplification of AsynchConnectContainerAction, change of wizards to use. Added IStatus constructors for exception classes.
Diffstat (limited to 'providers/bundles/org.eclipse.ecf.provider.irc.ui/src/org')
2 files changed, 5 insertions, 38 deletions
diff --git a/providers/bundles/org.eclipse.ecf.provider.irc.ui/src/org/eclipse/ecf/internal/irc/ui/IRCUI.java b/providers/bundles/org.eclipse.ecf.provider.irc.ui/src/org/eclipse/ecf/internal/irc/ui/IRCUI.java index 8b40cb6ed..67f667ea6 100644 --- a/providers/bundles/org.eclipse.ecf.provider.irc.ui/src/org/eclipse/ecf/internal/irc/ui/IRCUI.java +++ b/providers/bundles/org.eclipse.ecf.provider.irc.ui/src/org/eclipse/ecf/internal/irc/ui/IRCUI.java @@ -93,12 +93,7 @@ public class IRCUI extends ChatRoomManagerUI { System.arraycopy(tokens, 1, args, 0, tokens.length - 1); // JOIN can be done from root or channel if (command.equalsIgnoreCase(Messages.IRCUI_JOIN_COMMAND)) { - String arg1 = args[0]; - String arg2 = ""; //$NON-NLS-1$ - if (args.length > 1) { - arg2 = args[1]; - } - chatroomview.joinRoom(manager.getChatRoomInfo(arg1), arg2); + chatroomview.joinRoom(manager.getChatRoomInfo(args[0]), (args.length > 1)?args[1]:""); return null; } // QUIT can be done from root or channel diff --git a/providers/bundles/org.eclipse.ecf.provider.irc.ui/src/org/eclipse/ecf/internal/irc/ui/wizards/IRCConnectWizard.java b/providers/bundles/org.eclipse.ecf.provider.irc.ui/src/org/eclipse/ecf/internal/irc/ui/wizards/IRCConnectWizard.java index 232f18977..9475652a9 100644 --- a/providers/bundles/org.eclipse.ecf.provider.irc.ui/src/org/eclipse/ecf/internal/irc/ui/wizards/IRCConnectWizard.java +++ b/providers/bundles/org.eclipse.ecf.provider.irc.ui/src/org/eclipse/ecf/internal/irc/ui/wizards/IRCConnectWizard.java @@ -11,34 +11,24 @@ *****************************************************************************/ package org.eclipse.ecf.internal.irc.ui.wizards; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; import org.eclipse.ecf.core.IContainer; import org.eclipse.ecf.core.identity.ID; import org.eclipse.ecf.core.identity.IDCreateException; import org.eclipse.ecf.core.identity.IDFactory; import org.eclipse.ecf.core.security.ConnectContextFactory; import org.eclipse.ecf.core.security.IConnectContext; -import org.eclipse.ecf.core.util.IExceptionHandler; -import org.eclipse.ecf.internal.irc.ui.Activator; import org.eclipse.ecf.internal.irc.ui.IRCUI; import org.eclipse.ecf.presence.chatroom.IChatRoomManager; import org.eclipse.ecf.ui.IConnectWizard; import org.eclipse.ecf.ui.actions.AsynchContainerConnectAction; -import org.eclipse.ecf.ui.dialogs.ContainerConnectErrorDialog; -import org.eclipse.jface.dialogs.MessageDialog; +import org.eclipse.ecf.ui.dialogs.IDCreateErrorDialog; import org.eclipse.jface.wizard.Wizard; -import org.eclipse.osgi.util.NLS; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Shell; import org.eclipse.ui.IWorkbench; public final class IRCConnectWizard extends Wizard implements IConnectWizard { public static final String DEFAULT_GUEST_USER = "guest"; - private Shell shell; - private IRCConnectWizardPage page; private IContainer container; @@ -49,22 +39,6 @@ public final class IRCConnectWizard extends Wizard implements IConnectWizard { private String authorityAndPath = null; - private IExceptionHandler exceptionHandler = new IExceptionHandler() { - public IStatus handleException(final Throwable exception) { - if (exception != null) { - Display.getDefault().asyncExec(new Runnable() { - public void run() { - new ContainerConnectErrorDialog(shell, IStatus.ERROR, - "See Details", targetID.getName(), exception) - .open(); - } - }); - } - return new Status(IStatus.OK, Activator.PLUGIN_ID, IStatus.OK, - "Connected", null); - } - }; - public IRCConnectWizard() { super(); } @@ -80,7 +54,6 @@ public final class IRCConnectWizard extends Wizard implements IConnectWizard { } public void init(IWorkbench workbench, IContainer container) { - shell = workbench.getActiveWorkbenchWindow().getShell(); this.container = container; } @@ -93,20 +66,19 @@ public final class IRCConnectWizard extends Wizard implements IConnectWizard { targetID = IDFactory.getDefault().createID( container.getConnectNamespace(), connectID); } catch (IDCreateException e) { - MessageDialog.openError(shell, "Connect Error", NLS.bind( - "Invalid connect ID: {0}", connectID)); + new IDCreateErrorDialog(null,connectID,e).open(); return false; } IChatRoomManager manager = (IChatRoomManager) this.container .getAdapter(IChatRoomManager.class); - IRCUI ui = new IRCUI(this.container, manager, exceptionHandler); + IRCUI ui = new IRCUI(this.container, manager, null); ui.showForTarget(targetID); // If it's not already connected, then we connect this new container if (!ui.isContainerConnected()) new AsynchContainerConnectAction(this.container, this.targetID, - this.connectContext, exceptionHandler).run(null); + this.connectContext).run(); return true; |