Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorslewis2008-03-24 05:45:59 +0000
committerslewis2008-03-24 05:45:59 +0000
commite3d5b49c34fea0ebac88f862f94f92a49edba592 (patch)
treed3b8253fb0c4a17ce2a44505a2a0bb1116fffad3 /providers/bundles/org.eclipse.ecf.provider.irc.ui
parent66f37362dcfcf5726957e92d19da750b6dc78920 (diff)
downloadorg.eclipse.ecf-e3d5b49c34fea0ebac88f862f94f92a49edba592.tar.gz
org.eclipse.ecf-e3d5b49c34fea0ebac88f862f94f92a49edba592.tar.xz
org.eclipse.ecf-e3d5b49c34fea0ebac88f862f94f92a49edba592.zip
Enhancements/contributions from bug 222866. Also updated versions to 2.0.0 for core and filetransfer plugins
Diffstat (limited to 'providers/bundles/org.eclipse.ecf.provider.irc.ui')
-rw-r--r--providers/bundles/org.eclipse.ecf.provider.irc.ui/build.properties1
-rw-r--r--providers/bundles/org.eclipse.ecf.provider.irc.ui/icons/new_connection.gifbin0 -> 947 bytes
-rw-r--r--providers/bundles/org.eclipse.ecf.provider.irc.ui/plugin.properties2
-rw-r--r--providers/bundles/org.eclipse.ecf.provider.irc.ui/plugin.xml19
-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
8 files changed, 78 insertions, 20 deletions
diff --git a/providers/bundles/org.eclipse.ecf.provider.irc.ui/build.properties b/providers/bundles/org.eclipse.ecf.provider.irc.ui/build.properties
index 146cbd460..82e352855 100644
--- a/providers/bundles/org.eclipse.ecf.provider.irc.ui/build.properties
+++ b/providers/bundles/org.eclipse.ecf.provider.irc.ui/build.properties
@@ -2,6 +2,7 @@ source.. = src/
output.. = bin/
bin.includes = META-INF/,\
.,\
+ icons/,\
plugin.xml,\
about.html,\
plugin.properties
diff --git a/providers/bundles/org.eclipse.ecf.provider.irc.ui/icons/new_connection.gif b/providers/bundles/org.eclipse.ecf.provider.irc.ui/icons/new_connection.gif
new file mode 100644
index 000000000..4d4c6bb16
--- /dev/null
+++ b/providers/bundles/org.eclipse.ecf.provider.irc.ui/icons/new_connection.gif
Binary files differ
diff --git a/providers/bundles/org.eclipse.ecf.provider.irc.ui/plugin.properties b/providers/bundles/org.eclipse.ecf.provider.irc.ui/plugin.properties
index 16b5a7e63..ae87968d0 100644
--- a/providers/bundles/org.eclipse.ecf.provider.irc.ui/plugin.properties
+++ b/providers/bundles/org.eclipse.ecf.provider.irc.ui/plugin.properties
@@ -27,3 +27,5 @@ colorDefinition.ircMeColor = IRC /me color
colorDefinition.ircMeColor.description = Color of messages sent by local user using /me command.
fontDefinition.ircMeFont = IRC /me font
fontDefinition.ircMeFont.description = Font of messages sent by local user using /me command.
+
+IRCConnectWizardPage.description=Create a IRC connection
diff --git a/providers/bundles/org.eclipse.ecf.provider.irc.ui/plugin.xml b/providers/bundles/org.eclipse.ecf.provider.irc.ui/plugin.xml
index 31125e500..5decad62f 100644
--- a/providers/bundles/org.eclipse.ecf.provider.irc.ui/plugin.xml
+++ b/providers/bundles/org.eclipse.ecf.provider.irc.ui/plugin.xml
@@ -11,6 +11,25 @@
</extension>
<extension
+ point="org.eclipse.ui.newWizards">
+ <wizard
+ class="org.eclipse.ecf.internal.irc.ui.wizards.IRCConnectWizard"
+ id="org.eclipse.ecf.provider.ui.irc.connectWizard"
+ name="IRC"
+ icon="icons/new_connection.gif"
+ category="org.eclipse.ecf.ui.newConnection.category"
+ finalPerspective="org.eclipse.ecf.ui.perspective.communications">
+ <description>%IRCConnectWizardPage.description</description>
+ </wizard>
+ </extension>
+ <extension
+ point="org.eclipse.ui.perspectiveExtensions">
+ <perspectiveExtension targetID="org.eclipse.ecf.ui.perspective.communications">
+ <newWizardShortcut id="org.eclipse.ecf.provider.ui.irc.connectWizard"/>
+ </perspectiveExtension>
+ </extension>
+
+ <extension
point="org.eclipse.ui.workbench.texteditor.hyperlinkDetectors">
<hyperlinkDetector
activate="true"
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