Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorslewis2005-07-19 06:25:45 +0000
committerslewis2005-07-19 06:25:45 +0000
commit7ea1911deec6490cc586123efb6c24b7cac809db (patch)
treea3bf023503d5a5158be06c9c34b3e312ccfa6854
parentb4c79da6dd4149c3ef149e65c968da4aec98ea33 (diff)
downloadorg.eclipse.ecf-7ea1911deec6490cc586123efb6c24b7cac809db.tar.gz
org.eclipse.ecf-7ea1911deec6490cc586123efb6c24b7cac809db.tar.xz
org.eclipse.ecf-7ea1911deec6490cc586123efb6c24b7cac809db.zip
Added actions for connecting to OSL server. Changed menu items to connect to OSL rather than composent test server
-rw-r--r--examples/bundles/org.eclipse.ecf.example.collab/plugin.xml4
-rw-r--r--examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/example/collab/actions/ClientConnectOSLAction.java29
-rw-r--r--examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/example/collab/actions/ProjectPopupOSLAction.java73
3 files changed, 104 insertions, 2 deletions
diff --git a/examples/bundles/org.eclipse.ecf.example.collab/plugin.xml b/examples/bundles/org.eclipse.ecf.example.collab/plugin.xml
index f2878731d..fbbde7574 100644
--- a/examples/bundles/org.eclipse.ecf.example.collab/plugin.xml
+++ b/examples/bundles/org.eclipse.ecf.example.collab/plugin.xml
@@ -52,8 +52,8 @@
menubarPath="org.eclipse.ecf.example.collab.menu1/group1"
id="org.eclipse.ecf.client.joingroupwizardaction"/>
<action
- label="Join Test Collaboration (Composent)"
- class="org.eclipse.ecf.example.collab.actions.ProjectPopupComposentAction"
+ label="Join Test Collaboration (OSU OSL)"
+ class="org.eclipse.ecf.example.collab.actions.ProjectPopupOSLAction"
menubarPath="org.eclipse.ecf.example.collab.menu1/group2"
id="org.eclipse.ecf.example.collab.newAction"/>
<action
diff --git a/examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/example/collab/actions/ClientConnectOSLAction.java b/examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/example/collab/actions/ClientConnectOSLAction.java
new file mode 100644
index 000000000..232ee7911
--- /dev/null
+++ b/examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/example/collab/actions/ClientConnectOSLAction.java
@@ -0,0 +1,29 @@
+/****************************************************************************
+* Copyright (c) 2004 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
+*****************************************************************************/
+
+package org.eclipse.ecf.example.collab.actions;
+
+import org.eclipse.ecf.core.identity.IDFactory;
+
+
+public class ClientConnectOSLAction extends ClientConnectAction {
+
+ public static final String COMPOSENT_TARGET = "ecftcp://ecf1.osuosl.org:3282/server";
+
+ public ClientConnectOSLAction() {
+ super();
+ try {
+ targetID = IDFactory.getDefault().makeStringID(COMPOSENT_TARGET);
+ } catch (Exception e) {
+ throw new RuntimeException("Exception in ClientConnectAction()",e);
+ }
+ }
+} \ No newline at end of file
diff --git a/examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/example/collab/actions/ProjectPopupOSLAction.java b/examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/example/collab/actions/ProjectPopupOSLAction.java
new file mode 100644
index 000000000..2fe0cfe06
--- /dev/null
+++ b/examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/example/collab/actions/ProjectPopupOSLAction.java
@@ -0,0 +1,73 @@
+/****************************************************************************
+* Copyright (c) 2004 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
+*****************************************************************************/
+package org.eclipse.ecf.example.collab.actions;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.ui.IObjectActionDelegate;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.part.IShowInSource;
+import org.eclipse.ui.part.ShowInContext;
+
+public class ProjectPopupOSLAction implements IObjectActionDelegate {
+
+ /**
+ * Constructor for Action1.
+ */
+ public ProjectPopupOSLAction() {
+ super();
+ }
+
+ /**
+ * @see IObjectActionDelegate#setActivePart(IAction, IWorkbenchPart)
+ */
+ public void setActivePart(IAction action, IWorkbenchPart targetPart) {
+ project = null;
+ Object o = targetPart.getAdapter(IShowInSource.class);
+ if (o != null) {
+ IShowInSource sis = (IShowInSource) o;
+ ShowInContext sc = sis.getShowInContext();
+ ISelection s = sc.getSelection();
+ if (s instanceof IStructuredSelection) {
+ IStructuredSelection ss = (IStructuredSelection) s;
+ Object obj = ss.getFirstElement();
+ if (obj instanceof IJavaProject) {
+ IJavaProject ij = (IJavaProject) obj;
+ project = ij.getProject();
+ }
+ if (obj instanceof IProject) {
+ project = (IProject) obj;
+ }
+ }
+ }
+ }
+
+ /**
+ * @see IActionDelegate#run(IAction)
+ */
+ public void run(IAction action) {
+ ClientConnectOSLAction caction = new ClientConnectOSLAction();
+ caction.setProject(project);
+ caction.run(action);
+ }
+
+ IProject project;
+
+ /**
+ * @see IActionDelegate#selectionChanged(IAction, ISelection)
+ */
+ public void selectionChanged(IAction action, ISelection selection) {
+ }
+
+}

Back to the top