Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoruwe2013-09-04 04:19:26 -0400
committeruwe2013-09-04 04:19:26 -0400
commit19c9cc800fd14c7d5f84324a798255c4618f99c7 (patch)
tree44b5ff47045bb3ca4b59936c937145f414e3f7e8 /target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf
parentc4b02a17d54a72e7603c19ab2a1d23b95bff806d (diff)
downloadorg.eclipse.tcf-19c9cc800fd14c7d5f84324a798255c4618f99c7.tar.gz
org.eclipse.tcf-19c9cc800fd14c7d5f84324a798255c4618f99c7.tar.xz
org.eclipse.tcf-19c9cc800fd14c7d5f84324a798255c4618f99c7.zip
Target Explorer: Better handle cases where stepper steps for a given operation already exist
Diffstat (limited to 'target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf')
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/activator/UIPlugin.java30
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/AbstractConfigWizard.java22
2 files changed, 34 insertions, 18 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/activator/UIPlugin.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/activator/UIPlugin.java
index d5be38c17..6cf60cd4f 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/activator/UIPlugin.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/activator/UIPlugin.java
@@ -13,6 +13,7 @@ import java.net.URL;
import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.ListenerList;
+import org.eclipse.core.runtime.Platform;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.resource.ImageRegistry;
import org.eclipse.swt.graphics.Image;
@@ -26,6 +27,7 @@ import org.eclipse.tcf.te.runtime.services.interfaces.IService;
import org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext;
import org.eclipse.tcf.te.runtime.stepper.interfaces.IStepperService;
import org.eclipse.tcf.te.runtime.stepper.job.StepperJob;
+import org.eclipse.tcf.te.runtime.utils.StatusHelper;
import org.eclipse.tcf.te.tcf.core.Tcf;
import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.ILocatorModel;
import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel;
@@ -142,17 +144,23 @@ public class UIPlugin extends AbstractUIPlugin {
IPropertiesContainer data = stepperService.getStepData(peerModel, IStepperServiceOperations.DISCONNECT);
if (isEnabled && stepGroupId != null && stepContext != null) {
- StepperJob job = new StepperJob(name != null ? name : "", //$NON-NLS-1$
- stepContext,
- data,
- stepGroupId,
- IStepperServiceOperations.DISCONNECT,
- false);
-
- ICallback callback = new AsyncCallbackCollector.SimpleCollectorCallback(collector);
- job.setJobCallback(callback);
-
- job.schedule();
+ try {
+ StepperJob job = new StepperJob(name != null ? name : "", //$NON-NLS-1$
+ stepContext,
+ data,
+ stepGroupId,
+ IStepperServiceOperations.DISCONNECT,
+ false);
+
+ ICallback callback = new AsyncCallbackCollector.SimpleCollectorCallback(collector);
+ job.setJobCallback(callback);
+
+ job.schedule();
+ } catch (IllegalStateException e) {
+ if (Platform.inDebugMode()) {
+ getLog().log(StatusHelper.getStatus(e));
+ }
+ }
}
}
}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/AbstractConfigWizard.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/AbstractConfigWizard.java
index 9836198e2..5718123e3 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/AbstractConfigWizard.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/AbstractConfigWizard.java
@@ -10,6 +10,7 @@
package org.eclipse.tcf.te.tcf.ui.wizards;
import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.Platform;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer;
import org.eclipse.tcf.te.runtime.services.ServiceManager;
@@ -17,6 +18,7 @@ import org.eclipse.tcf.te.runtime.services.interfaces.IService;
import org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext;
import org.eclipse.tcf.te.runtime.stepper.interfaces.IStepperService;
import org.eclipse.tcf.te.runtime.stepper.job.StepperJob;
+import org.eclipse.tcf.te.runtime.utils.StatusHelper;
import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel;
import org.eclipse.tcf.te.tcf.locator.interfaces.services.IStepperServiceOperations;
import org.eclipse.tcf.te.tcf.ui.activator.UIPlugin;
@@ -89,14 +91,20 @@ public abstract class AbstractConfigWizard extends NewTargetWizard {
IPropertiesContainer data = stepperService.getStepData(peerModel, IStepperServiceOperations.CONNECT);
if (stepGroupId != null && stepContext != null) {
- StepperJob job = new StepperJob(name != null ? name : "", //$NON-NLS-1$
- stepContext,
- data,
- stepGroupId,
- IStepperServiceOperations.CONNECT,
- true);
+ try {
+ StepperJob job = new StepperJob(name != null ? name : "", //$NON-NLS-1$
+ stepContext,
+ data,
+ stepGroupId,
+ IStepperServiceOperations.CONNECT,
+ true);
- job.schedule();
+ job.schedule();
+ } catch (IllegalStateException e) {
+ if (Platform.inDebugMode()) {
+ UIPlugin.getDefault().getLog().log(StatusHelper.getStatus(e));
+ }
+ }
}
}
}

Back to the top