Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUwe Stieber2015-06-10 15:30:42 +0000
committerUwe Stieber2015-06-10 15:56:49 +0000
commit7d65f47449ed865302f9d0b59907c5a4c2a22f54 (patch)
treeb9c86f23a6c76bd1b9de96725a7f14bfb30ff0fc /target_explorer
parentb554abda0f5be4a4f0d01361177b8b37a1c930f1 (diff)
downloadorg.eclipse.tcf-7d65f47449ed865302f9d0b59907c5a4c2a22f54.tar.gz
org.eclipse.tcf-7d65f47449ed865302f9d0b59907c5a4c2a22f54.tar.xz
org.eclipse.tcf-7d65f47449ed865302f9d0b59907c5a4c2a22f54.zip
Target Explorer: Allow the default ping timeout to be configured
Diffstat (limited to 'target_explorer')
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/sections/PingTimeoutSection.java13
1 files changed, 10 insertions, 3 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/sections/PingTimeoutSection.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/sections/PingTimeoutSection.java
index 5721da653..6cee2255d 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/sections/PingTimeoutSection.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/sections/PingTimeoutSection.java
@@ -35,6 +35,8 @@ public class PingTimeoutSection extends AbstractSection implements IDataExchange
/* default */ Text verbosity;
/* default */ Label verbosityLabel;
+ private final int defaultPingTimeout;
+
/**
* Constructor.
*
@@ -42,7 +44,12 @@ public class PingTimeoutSection extends AbstractSection implements IDataExchange
* @param parent The parent composite. Must not be <code>null</code>.
*/
public PingTimeoutSection(IManagedForm form, Composite parent) {
+ this(form, parent, 2);
+ }
+
+ public PingTimeoutSection(IManagedForm form, Composite parent, int defaultPingTimeout) {
super(form, parent, SWT.NONE);
+ this.defaultPingTimeout = defaultPingTimeout >= 0 ? defaultPingTimeout : 2;
createClient(getSection(), form.getToolkit());
}
@@ -95,11 +102,11 @@ public class PingTimeoutSection extends AbstractSection implements IDataExchange
if (verbosity != null) {
int timeout = attributes.getIntProperty(IPeerProperties.PROP_PING_TIMEOUT);
- if (timeout >= 0) {
- SWTControlUtil.setText(verbosity, timeout+""); //$NON-NLS-1$
+ if (timeout >= 0 && timeout != defaultPingTimeout) {
+ SWTControlUtil.setText(verbosity, Integer.toString(timeout));
}
else {
- SWTControlUtil.setText(verbosity, "2"); //$NON-NLS-1$
+ SWTControlUtil.setText(verbosity, Integer.toString(defaultPingTimeout));
}
}
}

Back to the top