Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Schwarz2013-04-15 03:11:36 -0400
committerTobias Schwarz2013-04-15 03:11:36 -0400
commita429bbdb4dd1fc554688cee94f6a13185b33db65 (patch)
tree89f44ec6014bc06547d3c5086d2fe9d42480bd37 /target_explorer/plugins/org.eclipse.tcf.te.runtime.services/src
parentbc7419e92bbf4fea2b35fe61f58e38cb04307cd0 (diff)
downloadorg.eclipse.tcf-a429bbdb4dd1fc554688cee94f6a13185b33db65.tar.gz
org.eclipse.tcf-a429bbdb4dd1fc554688cee94f6a13185b33db65.tar.xz
org.eclipse.tcf-a429bbdb4dd1fc554688cee94f6a13185b33db65.zip
Target Explorer: use stepper for connect/disconnect
Diffstat (limited to 'target_explorer/plugins/org.eclipse.tcf.te.runtime.services/src')
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.runtime.services/src/org/eclipse/tcf/te/runtime/services/interfaces/IConnectionService.java68
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.runtime.services/src/org/eclipse/tcf/te/runtime/services/interfaces/IDebugService.java91
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.runtime.services/src/org/eclipse/tcf/te/runtime/services/internal/MenuServicePropertyTester.java83
3 files changed, 93 insertions, 149 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.runtime.services/src/org/eclipse/tcf/te/runtime/services/interfaces/IConnectionService.java b/target_explorer/plugins/org.eclipse.tcf.te.runtime.services/src/org/eclipse/tcf/te/runtime/services/interfaces/IConnectionService.java
deleted file mode 100644
index ec375ffa1..000000000
--- a/target_explorer/plugins/org.eclipse.tcf.te.runtime.services/src/org/eclipse/tcf/te/runtime/services/interfaces/IConnectionService.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2013 Wind River Systems, 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:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.tcf.te.runtime.services.interfaces;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.tcf.te.runtime.interfaces.callback.ICallback;
-
-/**
- * Connection service.
- * <p>
- * Allows to connect or disconnect to a given connectable context.
- */
-public interface IConnectionService extends IService {
-
- /**
- * The constants for the (cached) connection state.
- */
- public enum State { Disconnected, Connecting, Connected, Disconnecting }
-
- /**
- * Returns the connection state of the given connectable context.
- *
- * @param context The connectable context. Must not be <code>null</code>.
- * @return The connection state.
- */
- public State getState(Object context);
-
- /**
- * Connects the given connectable context.
- * <p>
- * If the given context is in connecting state, the callback is invoked once the
- * connectable enters the connected state.
- * <p>
- * If the given context is in connected state, the callback is invoked immediately.
- * <p>
- * If the given context is in disconnecting state, the callback is invoked immediately
- * with an cancel status.
- *
- * @param context The connectable context. Must not be <code>null</code>.
- * @param callback The callback. Must not be <code>null</code>.
- * @param monitor The progress monitor or <code>null</code>.
- */
- public void connect(Object context, ICallback callback, IProgressMonitor monitor);
-
- /**
- * Disconnects the given connectable context.
- * <p>
- * If the given context is in disconnecting state, the callback is invoked once the
- * connectable enters the disconnected state.
- * <p>
- * If the given context is in disconnected state, the callback is invoked immediately.
- * <p>
- * If the given context is in connecting state, the connect sequence is aborted and
- * rolled back. The callback is invoked once the connectable enters the disconnected state.
- *
- * @param context The connectable context. Must not be <code>null</code>.
- * @param callback The callback. Must not be <code>null</code>.
- * @param monitor The progress monitor or <code>null</code>.
- */
- public void disconnect(Object context, ICallback callback, IProgressMonitor monitor);
-}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.runtime.services/src/org/eclipse/tcf/te/runtime/services/interfaces/IDebugService.java b/target_explorer/plugins/org.eclipse.tcf.te.runtime.services/src/org/eclipse/tcf/te/runtime/services/interfaces/IDebugService.java
index 7a1aa975b..444b30513 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.runtime.services/src/org/eclipse/tcf/te/runtime/services/interfaces/IDebugService.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.runtime.services/src/org/eclipse/tcf/te/runtime/services/interfaces/IDebugService.java
@@ -1,39 +1,52 @@
-/*******************************************************************************
- * Copyright (c) 2011 Wind River Systems, 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:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.tcf.te.runtime.services.interfaces;
-
-import org.eclipse.tcf.te.runtime.interfaces.callback.ICallback;
-import org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer;
-
-/**
- * Debug service.
- * <p>
- * Allow to start and control the debugger for a set of given debug contexts.
- */
-public interface IDebugService extends IService {
-
- /**
- * Launches a debug session for the given context and attaches to it. The attach
- * can be parameterized via the data properties.
- *
- * @param context The debug context. Must not be <code>null</code>.
- * @param data The data properties to parameterize the attach. Must not be <code>null</code>.
- * @param callback The callback to invoke once the operation completed. Must not be <code>null</code>.
- */
- public void attach(Object context, IPropertiesContainer data, ICallback callback);
-
- /**
- * Returns if or if not the debugger has been launched for the given context.
- *
- * @param context The debug context. Must not be <code>null</code>.
- * @return <code>True</code> if the debugger has been launched for the context, <code>false</code> otherwise.
- */
- public boolean isLaunched(Object context);
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Wind River Systems, 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:
+ * Wind River Systems - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tcf.te.runtime.services.interfaces;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.tcf.te.runtime.interfaces.callback.ICallback;
+import org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer;
+
+/**
+ * Debug service.
+ * <p>
+ * Allow to start and control the debugger for a set of given debug contexts.
+ */
+public interface IDebugService extends IService {
+
+ /**
+ * Launches a debug session for the given context and attaches to it. The attach
+ * can be parameterized via the data properties.
+ *
+ * @param context The debug context. Must not be <code>null</code>.
+ * @param data The data properties to parameterize the attach. Must not be <code>null</code>.
+ * @param monitor The progress monitor.
+ * @param callback The callback to invoke once the operation completed. Must not be <code>null</code>.
+ */
+ public void attach(Object context, IPropertiesContainer data, IProgressMonitor monitor, ICallback callback);
+
+ /**
+ * Terminates a debug session for the given context and detaches it. The detach
+ * can be parameterized via the data properties.
+ *
+ * @param context The debug context. Must not be <code>null</code>.
+ * @param data The data properties to parameterize the detach. Must not be <code>null</code>.
+ * @param monitor The progress monitor.
+ * @param callback The callback to invoke once the operation completed. Must not be <code>null</code>.
+ */
+ public void detach(Object context, IPropertiesContainer data, IProgressMonitor monitor, ICallback callback);
+
+ /**
+ * Returns if or if not the debugger has been launched for the given context.
+ *
+ * @param context The debug context. Must not be <code>null</code>.
+ * @return <code>True</code> if the debugger has been launched for the context, <code>false</code> otherwise.
+ */
+ public boolean isLaunched(Object context);
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.runtime.services/src/org/eclipse/tcf/te/runtime/services/internal/MenuServicePropertyTester.java b/target_explorer/plugins/org.eclipse.tcf.te.runtime.services/src/org/eclipse/tcf/te/runtime/services/internal/MenuServicePropertyTester.java
index 6c2f9e8f7..7bae967ae 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.runtime.services/src/org/eclipse/tcf/te/runtime/services/internal/MenuServicePropertyTester.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.runtime.services/src/org/eclipse/tcf/te/runtime/services/internal/MenuServicePropertyTester.java
@@ -1,42 +1,41 @@
-/*******************************************************************************
- * Copyright (c) 2011 Wind River Systems, 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:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.tcf.te.runtime.services.internal;
-
-import org.eclipse.tcf.te.runtime.services.ServiceManager;
-import org.eclipse.tcf.te.runtime.services.interfaces.IMenuService;
-
-
-/**
- * Services plug-in property tester implementation.
- */
-public class MenuServicePropertyTester extends org.eclipse.core.expressions.PropertyTester {
-
- /* (non-Javadoc)
- * @see org.eclipse.core.expressions.IPropertyTester#test(java.lang.Object, java.lang.String, java.lang.Object[], java.lang.Object)
- */
- @Override
- public boolean test(Object receiver, String property, Object[] args, Object expectedValue) {
- // Get the menu service instance for the given receiver
- IMenuService service = ServiceManager.getInstance().getService(receiver, IMenuService.class);
- if (service != null) {
-
- // "isVisible": Checks if a given menu contribution shall be visible for the given receiver.
- if ("isVisible".equals(property)) { //$NON-NLS-1$
- // The menu contribution ID is the first argument
- String contributionID = args.length > 0 && args[0] instanceof String ? (String)args[0] : null;
- boolean isVisible = service.isVisible(receiver, contributionID);
- return expectedValue instanceof Boolean ? ((Boolean)expectedValue).booleanValue() == isVisible : false;
- }
- }
-
- return false;
- }
-
-}
+/*******************************************************************************
+ * Copyright (c) 2011 Wind River Systems, 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:
+ * Wind River Systems - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tcf.te.runtime.services.internal;
+
+import org.eclipse.tcf.te.runtime.services.ServiceManager;
+import org.eclipse.tcf.te.runtime.services.interfaces.IMenuService;
+
+/**
+ * Services plug-in property tester implementation.
+ */
+public class MenuServicePropertyTester extends org.eclipse.core.expressions.PropertyTester {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.core.expressions.IPropertyTester#test(java.lang.Object, java.lang.String, java.lang.Object[], java.lang.Object)
+ */
+ @Override
+ public boolean test(Object receiver, String property, Object[] args, Object expectedValue) {
+ // Get the menu service instance for the given receiver
+ IMenuService service = ServiceManager.getInstance().getService(receiver, IMenuService.class);
+ if (service != null) {
+
+ // "isVisible": Checks if a given menu contribution shall be visible for the given receiver.
+ if ("isVisible".equals(property)) { //$NON-NLS-1$
+ // The menu contribution ID is the first argument
+ String contributionID = args.length > 0 && args[0] instanceof String ? (String)args[0] : null;
+ boolean isVisible = service.isVisible(receiver, contributionID);
+ return expectedValue instanceof Boolean ? ((Boolean)expectedValue).booleanValue() == isVisible : false;
+ }
+ }
+
+ return false;
+ }
+
+}

Back to the top