diff options
author | rsuen | 2007-01-12 20:13:39 +0000 |
---|---|---|
committer | rsuen | 2007-01-12 20:13:39 +0000 |
commit | 6cb65ead7fcd323485b6d976e87361536ea44d58 (patch) | |
tree | 46457e047a80abbbec098af3a6f6e7febd6a246a /providers/bundles/org.eclipse.ecf.provider.irc.ui | |
parent | b091d259736af14fb59060464bfcdaad75f3703b (diff) | |
download | org.eclipse.ecf-6cb65ead7fcd323485b6d976e87361536ea44d58.tar.gz org.eclipse.ecf-6cb65ead7fcd323485b6d976e87361536ea44d58.tar.xz org.eclipse.ecf-6cb65ead7fcd323485b6d976e87361536ea44d58.zip |
Moving this from org.eclipse.ecf.irc.ui to org.eclipse.ecf.provider.irc.ui.
Diffstat (limited to 'providers/bundles/org.eclipse.ecf.provider.irc.ui')
11 files changed, 354 insertions, 0 deletions
diff --git a/providers/bundles/org.eclipse.ecf.provider.irc.ui/.classpath b/providers/bundles/org.eclipse.ecf.provider.irc.ui/.classpath new file mode 100644 index 000000000..ce7393340 --- /dev/null +++ b/providers/bundles/org.eclipse.ecf.provider.irc.ui/.classpath @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="src" path="src"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.4"/> + <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> + <classpathentry kind="output" path="bin"/> +</classpath> diff --git a/providers/bundles/org.eclipse.ecf.provider.irc.ui/.cvsignore b/providers/bundles/org.eclipse.ecf.provider.irc.ui/.cvsignore new file mode 100644 index 000000000..ba077a403 --- /dev/null +++ b/providers/bundles/org.eclipse.ecf.provider.irc.ui/.cvsignore @@ -0,0 +1 @@ +bin diff --git a/providers/bundles/org.eclipse.ecf.provider.irc.ui/.project b/providers/bundles/org.eclipse.ecf.provider.irc.ui/.project new file mode 100644 index 000000000..5f59f91cc --- /dev/null +++ b/providers/bundles/org.eclipse.ecf.provider.irc.ui/.project @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>org.eclipse.ecf.provider.irc.ui</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.pde.ManifestBuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.pde.SchemaBuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.pde.PluginNature</nature> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> diff --git a/providers/bundles/org.eclipse.ecf.provider.irc.ui/.settings/org.eclipse.jdt.core.prefs b/providers/bundles/org.eclipse.ecf.provider.irc.ui/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 000000000..315ebfe4e --- /dev/null +++ b/providers/bundles/org.eclipse.ecf.provider.irc.ui/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,12 @@ +#Fri Jan 12 00:00:23 GMT 2007 +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=1.4 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate +org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning +org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning +org.eclipse.jdt.core.compiler.source=1.3 diff --git a/providers/bundles/org.eclipse.ecf.provider.irc.ui/META-INF/MANIFEST.MF b/providers/bundles/org.eclipse.ecf.provider.irc.ui/META-INF/MANIFEST.MF new file mode 100644 index 000000000..d4f6e1d65 --- /dev/null +++ b/providers/bundles/org.eclipse.ecf.provider.irc.ui/META-INF/MANIFEST.MF @@ -0,0 +1,16 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Ui Plug-in +Bundle-SymbolicName: org.eclipse.ecf.irc.ui;singleton:=true +Bundle-Version: 1.0.0 +Bundle-Activator: org.eclipse.ecf.internal.irc.ui.Activator +Bundle-Localization: plugin +Require-Bundle: org.eclipse.core.runtime, + org.eclipse.ecf.ui, + org.eclipse.ecf, + org.eclipse.ui, + org.eclipse.ecf.presence +Eclipse-LazyStart: true +Export-Package: org.eclipse.ecf.internal.irc.ui;x-internal:=true, + org.eclipse.ecf.internal.irc.ui.wizards;x-internal:=true +Bundle-RequiredExecutionEnvironment: J2SE-1.4 diff --git a/providers/bundles/org.eclipse.ecf.provider.irc.ui/about.html b/providers/bundles/org.eclipse.ecf.provider.irc.ui/about.html new file mode 100644 index 000000000..8f7767892 --- /dev/null +++ b/providers/bundles/org.eclipse.ecf.provider.irc.ui/about.html @@ -0,0 +1,29 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
+<title>About</title>
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>June 2, 2006</p>
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, "Program" will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
+being redistributed by another party ("Redistributor") and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was
+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="http://www.eclipse.org">http://www.eclipse.org</a>.</p>
+
+</body>
+</html>
+
diff --git a/providers/bundles/org.eclipse.ecf.provider.irc.ui/build.properties b/providers/bundles/org.eclipse.ecf.provider.irc.ui/build.properties new file mode 100644 index 000000000..6f20375d6 --- /dev/null +++ b/providers/bundles/org.eclipse.ecf.provider.irc.ui/build.properties @@ -0,0 +1,5 @@ +source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml
diff --git a/providers/bundles/org.eclipse.ecf.provider.irc.ui/plugin.xml b/providers/bundles/org.eclipse.ecf.provider.irc.ui/plugin.xml new file mode 100644 index 000000000..72ac1f846 --- /dev/null +++ b/providers/bundles/org.eclipse.ecf.provider.irc.ui/plugin.xml @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.2"?>
+<plugin>
+ <extension
+ point="org.eclipse.ecf.ui.configurationWizards">
+ <wizard
+ category="org.eclipse.ecf.ui.clientcategory"
+ class="org.eclipse.ecf.ui.wizards.EmptyConfigurationWizard"
+ containerFactoryName="ecf.irc.irclib"
+ id="org.eclipse.ecf.irc.ui.wizard1"
+ name="org.eclipse.ecf.irc.ui.wizard1"/>
+ </extension>
+ <extension
+ point="org.eclipse.ecf.ui.connectWizards">
+ <wizard
+ class="org.eclipse.ecf.internal.irc.ui.wizards.IRCConnectWizard"
+ containerFactoryName="ecf.irc.irclib"
+ id="org.eclipse.ecf.provider.ui.irc.connectWizard"
+ name="IRC"/>
+ </extension>
+</plugin>
diff --git a/providers/bundles/org.eclipse.ecf.provider.irc.ui/src/org/eclipse/ecf/internal/irc/ui/Activator.java b/providers/bundles/org.eclipse.ecf.provider.irc.ui/src/org/eclipse/ecf/internal/irc/ui/Activator.java new file mode 100644 index 000000000..68e574963 --- /dev/null +++ b/providers/bundles/org.eclipse.ecf.provider.irc.ui/src/org/eclipse/ecf/internal/irc/ui/Activator.java @@ -0,0 +1,62 @@ +/****************************************************************************
+ * Copyright (c) 2007 Remy Suen, 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:
+ * Remy Suen <remy.suen@gmail.com> - initial API and implementation
+ *****************************************************************************/
+package org.eclipse.ecf.internal.irc.ui;
+
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends AbstractUIPlugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.eclipse.ecf.irc.ui"; //$NON-NLS-1$
+
+ // The shared instance
+ private static Activator plugin;
+
+ /**
+ * The constructor
+ */
+ public Activator() {
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault() {
+ return plugin;
+ }
+
+}
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 new file mode 100644 index 000000000..d765a0e4e --- /dev/null +++ b/providers/bundles/org.eclipse.ecf.provider.irc.ui/src/org/eclipse/ecf/internal/irc/ui/wizards/IRCConnectWizard.java @@ -0,0 +1,90 @@ +/****************************************************************************
+ * Copyright (c) 2007 Remy Suen, 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:
+ * Remy Suen <remy.suen@gmail.com> - initial API and implementation
+ *****************************************************************************/
+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.ui.IConnectWizard;
+import org.eclipse.ecf.ui.actions.AsynchContainerConnectAction;
+import org.eclipse.ecf.ui.dialogs.ContainerConnectErrorDialog;
+import org.eclipse.jface.wizard.Wizard;
+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 {
+
+ private static final int CONNECT_ERROR_CODE = 7777;
+
+ private Shell shell;
+
+ private IRCConnectWizardPage page;
+
+ private IContainer container;
+
+ private ID targetID;
+
+ private IConnectContext connectContext;
+
+ public void addPages() {
+ page = new IRCConnectWizardPage();
+ addPage(page);
+ }
+
+ public void init(IWorkbench workbench, IContainer container) {
+ shell = workbench.getActiveWorkbenchWindow().getShell();
+ this.container = container;
+ }
+
+ public boolean performFinish() {
+ connectContext = ConnectContextFactory
+ .createPasswordConnectContext(page.getPassword());
+
+ try {
+ targetID = IDFactory.getDefault().createID(
+ container.getConnectNamespace(), page.getConnectID());
+ } catch (IDCreateException e) {
+ // TODO: This needs to be handled properly
+ e.printStackTrace();
+ return false;
+ }
+
+ new AsynchContainerConnectAction(this.container, this.targetID,
+ this.connectContext, new IExceptionHandler() {
+ public IStatus handleException(final Throwable exception) {
+ if (exception != null) {
+ Display.getDefault().asyncExec(new Runnable() {
+ public void run() {
+ new ContainerConnectErrorDialog(shell,
+ CONNECT_ERROR_CODE, "See Details",
+ targetID.getName(), exception)
+ .open();
+ }
+ });
+ }
+ return new Status(IStatus.OK, Activator.PLUGIN_ID, 0,
+ "", null);
+ }
+
+ }).run(null);
+
+ return true;
+ }
+
+}
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 new file mode 100644 index 000000000..614392566 --- /dev/null +++ b/providers/bundles/org.eclipse.ecf.provider.irc.ui/src/org/eclipse/ecf/internal/irc/ui/wizards/IRCConnectWizardPage.java @@ -0,0 +1,83 @@ +/**************************************************************************** + * Copyright (c) 2007 Remy Suen, 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: + * Remy Suen <remy.suen@gmail.com> - initial API and implementation + *****************************************************************************/ +package org.eclipse.ecf.internal.irc.ui.wizards; + +import org.eclipse.jface.wizard.WizardPage; +import org.eclipse.swt.SWT; +import org.eclipse.swt.events.ModifyEvent; +import org.eclipse.swt.events.ModifyListener; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Label; +import org.eclipse.swt.widgets.Text; + +final class IRCConnectWizardPage extends WizardPage { + + private Text connectText; + + private Text passwordText; + + IRCConnectWizardPage() { + super(""); + setTitle("IRC Connection Wizard"); + setDescription("Specify a nickname and IRC server to connect to."); + } + + public void createControl(Composite parent) { + 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); + + Label label = new Label(parent, SWT.LEFT); + label.setText("Connect ID:"); + + connectText = new Text(parent, SWT.SINGLE | SWT.BORDER); + connectText.setLayoutData(fillData); + connectText.addModifyListener(new ModifyListener() { + public void modifyText(ModifyEvent e) { + if (!connectText.getText().equals("")) { //$NON-NLS-1$ + updateStatus(null); + } else { + updateStatus("An connect ID must be specified."); + } + } + }); + + label = new Label(parent, SWT.RIGHT); + label.setText("irc://<user>@<ircserver>[/<#channel>]"); + label.setLayoutData(endData); + + label = new Label(parent, SWT.LEFT); + label.setText("Password:"); + passwordText = new Text(parent, SWT.SINGLE | SWT.PASSWORD | SWT.BORDER); + passwordText.setLayoutData(fillData); + label = new Label(parent, SWT.RIGHT | SWT.WRAP); + label.setText("This password is for password-protected IRC servers."); + label.setLayoutData(endData); + + setControl(parent); + } + + String getConnectID() { + return connectText.getText(); + } + + String getPassword() { + return passwordText.getText(); + } + + private void updateStatus(String message) { + setErrorMessage(message); + setPageComplete(message == null); + } + +} |