Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'providers/bundles/org.eclipse.ecf.provider.irc.ui/src/org/eclipse/ecf/internal/irc/ui')
-rw-r--r--providers/bundles/org.eclipse.ecf.provider.irc.ui/src/org/eclipse/ecf/internal/irc/ui/Messages.java3
-rw-r--r--providers/bundles/org.eclipse.ecf.provider.irc.ui/src/org/eclipse/ecf/internal/irc/ui/messages.properties16
-rw-r--r--providers/bundles/org.eclipse.ecf.provider.irc.ui/src/org/eclipse/ecf/internal/irc/ui/wizards/IRCConnectWizard.java53
-rw-r--r--providers/bundles/org.eclipse.ecf.provider.irc.ui/src/org/eclipse/ecf/internal/irc/ui/wizards/IRCConnectWizardPage.java4
4 files changed, 56 insertions, 20 deletions
diff --git a/providers/bundles/org.eclipse.ecf.provider.irc.ui/src/org/eclipse/ecf/internal/irc/ui/Messages.java b/providers/bundles/org.eclipse.ecf.provider.irc.ui/src/org/eclipse/ecf/internal/irc/ui/Messages.java
index 351998014..b9df43d8f 100644
--- a/providers/bundles/org.eclipse.ecf.provider.irc.ui/src/org/eclipse/ecf/internal/irc/ui/Messages.java
+++ b/providers/bundles/org.eclipse.ecf.provider.irc.ui/src/org/eclipse/ecf/internal/irc/ui/Messages.java
@@ -35,6 +35,9 @@ public class Messages extends NLS {
public static String IRCUI_JOIN_COMMAND;
public static String IRCUI_PART_COMMAND;
public static String IRCUI_QUIT_COMMAND;
+
+ public static String IRCConnectWizard_WIZARD_TITLE;
+
static {
// initialize resource bundle
NLS.initializeMessages(BUNDLE_NAME, Messages.class);
diff --git a/providers/bundles/org.eclipse.ecf.provider.irc.ui/src/org/eclipse/ecf/internal/irc/ui/messages.properties b/providers/bundles/org.eclipse.ecf.provider.irc.ui/src/org/eclipse/ecf/internal/irc/ui/messages.properties
index 0477bef92..466762407 100644
--- a/providers/bundles/org.eclipse.ecf.provider.irc.ui/src/org/eclipse/ecf/internal/irc/ui/messages.properties
+++ b/providers/bundles/org.eclipse.ecf.provider.irc.ui/src/org/eclipse/ecf/internal/irc/ui/messages.properties
@@ -1,3 +1,15 @@
+################################################################################
+# Copyright (c) 2007 Composent, Inc. and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Composent, Inc. - initial API and implementation
+# Jacek Pospychala <jacek.pospychala@pl.ibm.com> - bug 190851
+################################################################################
+
IRCHyperlink_EXCEPTION_IRC_HYPERLINK=Exception in IRC hyperlink open
IRCConnectWizardPage_CONNECTID_LABEL=Connect ID:
IRCConnectWizardPage_PASSWORD_LABEL=Password:
@@ -15,4 +27,6 @@ IRCConnectWizardPage_STATUS_MESSAGE_MALFORMED=The connect ID is malformed.
IRCConnectWizardPage_CONNECTID_EXAMPLE=<user>@<ircserver>[:port][/<channel>,<channel2>,...]
IRCConnectWizardPage_PASSWORD_INFO=Password is for password-protected IRC servers.
-IRCConnectWizardPage_CONNECTID_DEFAULT=ecfuser{0}@irc.freenode.net/#eclipse \ No newline at end of file
+IRCConnectWizardPage_CONNECTID_DEFAULT=ecfuser{0}@irc.freenode.net/#eclipse
+
+IRCConnectWizard_WIZARD_TITLE=New IRC Connection
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 21c08f45f..3c19c9678 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,6 +11,8 @@
*****************************************************************************/
package org.eclipse.ecf.internal.irc.ui.wizards;
+import org.eclipse.ecf.core.ContainerCreateException;
+import org.eclipse.ecf.core.ContainerFactory;
import org.eclipse.ecf.core.IContainer;
import org.eclipse.ecf.core.identity.ID;
import org.eclipse.ecf.core.identity.IDCreateException;
@@ -18,18 +20,21 @@ 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.internal.irc.ui.IRCUI;
+import org.eclipse.ecf.internal.irc.ui.Messages;
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.IDCreateErrorDialog;
import org.eclipse.ecf.ui.util.PasswordCacheHelper;
+import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.ui.INewWizard;
import org.eclipse.ui.IWorkbench;
-public final class IRCConnectWizard extends Wizard implements IConnectWizard {
+public final class IRCConnectWizard extends Wizard implements IConnectWizard, INewWizard {
public static final String DEFAULT_GUEST_USER = "guest";
-
+
private IRCConnectWizardPage page;
private IContainer container;
@@ -56,50 +61,60 @@ public final class IRCConnectWizard extends Wizard implements IConnectWizard {
public void init(IWorkbench workbench, IContainer container) {
this.container = container;
+
+ setWindowTitle(Messages.IRCConnectWizard_WIZARD_TITLE);
+ }
+
+ public void init(IWorkbench workbench, IStructuredSelection selection) {
+ this.container = null;
+ try {
+ this.container = ContainerFactory.getDefault().createContainer("ecf.irc.irclib");
+ } catch (final ContainerCreateException e) {
+ // None
+ }
+
+ setWindowTitle(Messages.IRCConnectWizard_WIZARD_TITLE);
}
public boolean performFinish() {
-
+
final String connectID = page.getConnectID();
final String password = page.getPassword();
-
- connectContext = ConnectContextFactory
- .createPasswordConnectContext(password);
+
+ connectContext = ConnectContextFactory.createPasswordConnectContext(password);
page.saveComboText();
-
+
try {
- targetID = IDFactory.getDefault().createID(
- container.getConnectNamespace(), connectID);
- } catch (IDCreateException e) {
- new IDCreateErrorDialog(null,connectID,e).open();
+ targetID = IDFactory.getDefault().createID(container.getConnectNamespace(), connectID);
+ } catch (final IDCreateException e) {
+ new IDCreateErrorDialog(null, connectID, e).open();
return false;
}
- IChatRoomManager manager = (IChatRoomManager) this.container
- .getAdapter(IChatRoomManager.class);
+ final IChatRoomManager manager = (IChatRoomManager) this.container.getAdapter(IChatRoomManager.class);
- IRCUI ui = new IRCUI(this.container, manager, null);
+ final 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()) {
page.saveComboItems();
new AsynchContainerConnectAction(container, targetID, connectContext, null, new Runnable() {
public void run() {
- cachePassword(page.getPasswordKeyFromUserName(connectID),password);
- }}).run();
+ cachePassword(page.getPasswordKeyFromUserName(connectID), password);
+ }
+ }).run();
}
-
return true;
}
protected void cachePassword(final String connectID, String password) {
if (password != null && !password.equals("")) {
- PasswordCacheHelper pwStorage = new PasswordCacheHelper(connectID);
+ final PasswordCacheHelper pwStorage = new PasswordCacheHelper(connectID);
pwStorage.savePassword(password);
}
}
-
+
}
diff --git a/providers/bundles/org.eclipse.ecf.provider.irc.ui/src/org/eclipse/ecf/internal/irc/ui/wizards/IRCConnectWizardPage.java b/providers/bundles/org.eclipse.ecf.provider.irc.ui/src/org/eclipse/ecf/internal/irc/ui/wizards/IRCConnectWizardPage.java
index 6711ec537..c8375a60c 100644
--- a/providers/bundles/org.eclipse.ecf.provider.irc.ui/src/org/eclipse/ecf/internal/irc/ui/wizards/IRCConnectWizardPage.java
+++ b/providers/bundles/org.eclipse.ecf.provider.irc.ui/src/org/eclipse/ecf/internal/irc/ui/wizards/IRCConnectWizardPage.java
@@ -85,6 +85,9 @@ final class IRCConnectWizardPage extends WizardPage {
}
public void createControl(Composite parent) {
+
+ parent = new Composite(parent, SWT.NONE);
+
parent.setLayout(new GridLayout());
GridData fillData = new GridData(SWT.FILL, SWT.CENTER, true, false);
GridData endData = new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1);
@@ -130,6 +133,7 @@ final class IRCConnectWizardPage extends WizardPage {
passwordText.setFocus();
}
+ org.eclipse.jface.dialogs.Dialog.applyDialogFont(parent);
setControl(parent);
}

Back to the top