Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Schwarz2014-11-13 13:04:10 +0000
committerTobias Schwarz2014-11-13 13:04:10 +0000
commit6466ab5bd573bd7bbac6fefd7f30e7440934e448 (patch)
treeda40a65386a14fe82109be7e2f95354c1a6e305d /target_explorer/plugins/org.eclipse.tcf.te.tcf.ui
parent0f2b147550f9be59472e7eb6eb12de075f2c65be (diff)
downloadorg.eclipse.tcf-6466ab5bd573bd7bbac6fefd7f30e7440934e448.tar.gz
org.eclipse.tcf-6466ab5bd573bd7bbac6fefd7f30e7440934e448.tar.xz
org.eclipse.tcf-6466ab5bd573bd7bbac6fefd7f30e7440934e448.zip
SM: make "connect on finish" configurable
Diffstat (limited to 'target_explorer/plugins/org.eclipse.tcf.te.tcf.ui')
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/interfaces/IPreferenceKeys.java6
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/NewWizard.java18
2 files changed, 18 insertions, 6 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/interfaces/IPreferenceKeys.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/interfaces/IPreferenceKeys.java
index e7f352075..115650816 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/interfaces/IPreferenceKeys.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/interfaces/IPreferenceKeys.java
@@ -23,4 +23,10 @@ public interface IPreferenceKeys {
* Defaults to 20.
*/
public final String PREF_MAX_RECENT_ACTION_ENTRIES = PREFIX + "maxRecentActions"; //$NON-NLS-1$
+
+ /**
+ * Key prefix for auto connect setting in new wizards.
+ * The key needs to be followed by the connection type id.
+ */
+ public final String PREF_AUTO_CONNECT = "autoConnect."; //$NON-NLS-1$
}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/NewWizard.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/NewWizard.java
index 8d1763e8d..34bc127d9 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/NewWizard.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/NewWizard.java
@@ -39,6 +39,8 @@ import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode;
import org.eclipse.tcf.te.tcf.locator.interfaces.services.IPeerModelLookupService;
import org.eclipse.tcf.te.tcf.locator.interfaces.services.IPeerModelRefreshService;
import org.eclipse.tcf.te.tcf.locator.model.ModelManager;
+import org.eclipse.tcf.te.tcf.ui.activator.UIPlugin;
+import org.eclipse.tcf.te.tcf.ui.interfaces.IPreferenceKeys;
import org.eclipse.tcf.te.tcf.ui.nls.Messages;
import org.eclipse.tcf.te.tcf.ui.wizards.pages.NewTargetWizardPage;
import org.eclipse.tcf.te.ui.interfaces.data.IDataExchangeNode;
@@ -80,8 +82,7 @@ public class NewWizard extends AbstractNewConfigWizard {
key.equals(IPeer.ATTR_TRANSPORT_NAME) ||
key.equals(IPeer.ATTR_IP_HOST) ||
key.equals(IPeer.ATTR_IP_PORT) ||
- key.equals(IPeerProperties.PROP_PROXIES) ||
- key.equals(IPeerProperties.PROP_AUTO_CONNECT);
+ key.equals(IPeerProperties.PROP_PROXIES);
}
/* (non-Javadoc)
@@ -90,6 +91,8 @@ public class NewWizard extends AbstractNewConfigWizard {
@Override
protected IPropertiesContainer getInitialData() {
IStructuredSelection selection = getSelection();
+ final IPropertiesContainer data = new PropertiesContainer();
+
if (selection != null) {
final IPeer peer;
boolean isPeerNode = false;
@@ -111,7 +114,6 @@ public class NewWizard extends AbstractNewConfigWizard {
String selPeerType = peer.getAttributes().get(IPeerProperties.PROP_TYPE);
final boolean sameType = getPeerType() == null ? selPeerType == null : getPeerType().equals(selPeerType);
final boolean finIsPeerNode = isPeerNode;
- final IPropertiesContainer data = new PropertiesContainer();
Protocol.invokeAndWait(new Runnable() {
@Override
public void run() {
@@ -122,11 +124,15 @@ public class NewWizard extends AbstractNewConfigWizard {
}
}
});
-
- return data;
}
}
- return super.getInitialData();
+
+ String autoConnectValue = UIPlugin.getScopedPreferences().getString(IPreferenceKeys.PREF_AUTO_CONNECT+getPeerType());
+ boolean autoConnect = autoConnectValue != null ? UIPlugin.getScopedPreferences().getBoolean(IPreferenceKeys.PREF_AUTO_CONNECT+getPeerType()) : true;
+ data.setProperty(IPeerProperties.PROP_AUTO_CONNECT, autoConnect);
+ data.setProperty(IPeerProperties.PROP_TYPE, getPeerType());
+
+ return data;
}
/**

Back to the top