diff options
author | Tobias Schwarz | 2014-10-10 10:41:24 +0000 |
---|---|---|
committer | Tobias Schwarz | 2014-10-10 10:41:24 +0000 |
commit | dd5c13530e098d8b9722706a7d6e0e09d3d625db (patch) | |
tree | b817c05c0d1d1e48f4a9f9ae18524a562b44eb10 /target_explorer | |
parent | 97d1af9eea078629618cf6fb78e97baffeac8b83 (diff) | |
download | org.eclipse.tcf-dd5c13530e098d8b9722706a7d6e0e09d3d625db.tar.gz org.eclipse.tcf-dd5c13530e098d8b9722706a7d6e0e09d3d625db.tar.xz org.eclipse.tcf-dd5c13530e098d8b9722706a7d6e0e09d3d625db.zip |
Target Explorer: introduce connection subtype and mode
Diffstat (limited to 'target_explorer')
33 files changed, 305 insertions, 171 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/interfaces/IPeerProperties.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/interfaces/IPeerProperties.java index 8898f513d..a23ce69d2 100644 --- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/interfaces/IPeerProperties.java +++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/interfaces/IPeerProperties.java @@ -9,6 +9,7 @@ *******************************************************************************/ package org.eclipse.tcf.te.tcf.core.interfaces; +import org.eclipse.tcf.te.core.nodes.interfaces.wire.IWireTypeNetwork; import org.eclipse.tcf.te.tcf.core.util.persistence.PeerDataHelper; /** @@ -36,7 +37,98 @@ public interface IPeerProperties { /** * Property: The list of supported platforms. */ - public static final String ATTR_PLATFORMS = "Platforms"; //$NON-NLS-1$ + public static final String PROP_PLATFORMS = "Platforms"; //$NON-NLS-1$ + /** + * Property: The connection subtype (real/sim/...). + */ + public static final String PROP_SUBTYPE= "SubType"; //$NON-NLS-1$ + + /** + * Peer "SubType" attribute value for real target. + */ + public static final String SUBTYPE_REAL = "real"; //$NON-NLS-1$ + + /** + * Peer "SubType" attribute value for simulator. + */ + public static final String SUBTYPE_SIM = "sim"; //$NON-NLS-1$ + + /** + * Property: The connection mode (run/stop/...). + */ + public static final String PROP_MODE= "Mode"; //$NON-NLS-1$ + + /** + * Peer "Mode" attribute value for application mode. + */ + public static final String MODE_RUN = "run"; //$NON-NLS-1$ + + /** + * Peer "Mode" attribute value for stop mode. + */ + public static final String MODE_STOP = "stop"; //$NON-NLS-1$ + + /** + * Property: The connection mode properties. + */ + public static final String PROP_MODE_PROPERTIES = "ModeProperties"; //$NON-NLS-1$ + + /** + * Property: The kernel image. + */ + public static final String PROP_KERNEL_IMAGE= "KernelImage"; //$NON-NLS-1$ + + /** + * Property: The peer type. + */ + public static final String PROP_TYPE = "Type"; //$NON-NLS-1$ + + /** + * Property: List of TCF services the peer would have when it goes online (comma separated list). + */ + public static final String PROP_OFFLINE_SERVICES = "OfflineServices"; //$NON-NLS-1$ + + /** + * Property: The peer visible state. + */ + public static final String PROP_VISIBLE = "Visible"; //$NON-NLS-1$ + + /** + * Property: Simulator properties + */ + public static final String PROP_SIM_PROPERTIES = "SimulatorProperties"; //$NON-NLS-1$ + + /** + * Property: Last selected simulator type + */ + public static final String PROP_SIM_TYPE = "SimulatorType"; //$NON-NLS-1$ + + /** + * Property: Auto-start the debugger after the agent launch. + */ + public static final String PROP_AUTO_START_DEBUGGER = "autoStartDebugger"; //$NON-NLS-1$ + + /** + * Property: Connect after the configuration has been created. + */ + public static final String PROP_AUTO_CONNECT = "autoConnect"; //$NON-NLS-1$ + + /** + * Property: Ping interval. + */ + public static String PROP_PING_INTERVAL = "pingInterval"; //$NON-NLS-1$ + + /** + * Property: Ping timeout. + */ + public static String PROP_PING_TIMEOUT = "pingTimeout"; //$NON-NLS-1$ + + public static String DEFAULT_PING_TIMEOUT = "2"; //$NON-NLS-1$ + + /** + * The network port is a "auto port" (automatically determined and read-only to the user). + */ + public static final String PROP_IP_PORT_IS_AUTO = IWireTypeNetwork.PROPERTY_NETWORK_PORT_IS_AUTO; } diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/delegates/PeerNodeValidationDelegate.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/delegates/PeerNodeValidationDelegate.java index bc5c8f3e0..ff791d1db 100644 --- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/delegates/PeerNodeValidationDelegate.java +++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/delegates/PeerNodeValidationDelegate.java @@ -14,7 +14,7 @@ import java.util.concurrent.atomic.AtomicBoolean; import org.eclipse.tcf.protocol.IPeer; import org.eclipse.tcf.protocol.Protocol; -import org.eclipse.tcf.te.core.nodes.interfaces.wire.IWireTypeNetwork; +import org.eclipse.tcf.te.tcf.core.interfaces.IPeerProperties; import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode; import org.eclipse.tcf.te.tcf.locator.utils.SimulatorUtils; @@ -42,7 +42,7 @@ public class PeerNodeValidationDelegate implements IPeerNode.IDelegate { // For TCP or SSL transport, ATTR_IP_HOST must not be null. String ip = peerNode.getPeer().getAttributes().get(IPeer.ATTR_IP_HOST); String port = peerNode.getPeer().getAttributes().get(IPeer.ATTR_IP_PORT); - String autoPortString = peerNode.getPeer().getAttributes().get(IWireTypeNetwork.PROPERTY_NETWORK_PORT_IS_AUTO); + String autoPortString = peerNode.getPeer().getAttributes().get(IPeerProperties.PROP_IP_PORT_IS_AUTO); boolean autoPort = Boolean.parseBoolean(autoPortString); if (("TCP".equals(transport) || "SSL".equals(transport)) && (ip == null || (!autoPort && port == null))) { //$NON-NLS-1$ //$NON-NLS-2$ valid.set(false); diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/nodes/IPeerNodeProperties.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/nodes/IPeerNodeProperties.java index 19e4da2ae..c384f5b84 100644 --- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/nodes/IPeerNodeProperties.java +++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/nodes/IPeerNodeProperties.java @@ -10,7 +10,6 @@ package org.eclipse.tcf.te.tcf.locator.interfaces.nodes; import org.eclipse.tcf.protocol.IPeer; -import org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer; /** * Default set of peer node properties. @@ -20,7 +19,7 @@ public interface IPeerNodeProperties { /** * Property: The peer node connect state. */ - public static final String PROP_CONNECT_STATE = "connectState"; //$NON-NLS-1$ + public static final String PROP_CONNECT_STATE = "ConnectState"; //$NON-NLS-1$ /** * Property: The peer instance. Object stored here must be @@ -31,12 +30,12 @@ public interface IPeerNodeProperties { /** * Property: The list of known local service names. */ - public static final String PROP_LOCAL_SERVICES = "services.local"; //$NON-NLS-1$ + public static final String PROP_LOCAL_SERVICES = "LocalServices"; //$NON-NLS-1$ /** * Property: The list of known remote service names. */ - public static final String PROP_REMOTE_SERVICES = "services.remote"; //$NON-NLS-1$ + public static final String PROP_REMOTE_SERVICES = "RemoteServices"; //$NON-NLS-1$ /** * Property: Peer ID of selected real target. @@ -44,57 +43,7 @@ public interface IPeerNodeProperties { public static final String PROP_PEER_ID = "PeerId"; //$NON-NLS-1$ /** - * Property: Ping interval. - */ - public static String PROP_PING_INTERVAL = "pingInterval"; //$NON-NLS-1$ - - /** - * Property: Ping timeout. - */ - public static String PROP_PING_TIMEOUT = "pingTimeout"; //$NON-NLS-1$ - - /** * Property: The peer valid state. This is not a property itself, just used to fire change events on valid state change. */ public static final String PROP_VALID = "valid"; //$NON-NLS-1$ - - /** - * Property: The peer type. - */ - public static final String PROP_TYPE = "Type" + IPropertiesContainer.PERSISTENT_PROPERTY; //$NON-NLS-1$ - - /** - * Property: List of TCF services the peer would have when it goes online (comma separated list). - */ - public static final String PROP_OFFLINE_SERVICES = "OfflineServices" + IPropertiesContainer.PERSISTENT_PROPERTY; //$NON-NLS-1$ - - /** - * Property: The peer visible state. - */ - public static final String PROP_VISIBLE = "Visible" + IPropertiesContainer.PERSISTENT_PROPERTY; //$NON-NLS-1$ - - /** - * Property: Launch simulator - */ - public static final String PROP_SIM_ENABLED = "SimulatorEnabled" + IPropertiesContainer.PERSISTENT_PROPERTY; //$NON-NLS-1$ - - /** - * Property: Simulator properties - */ - public static final String PROP_SIM_PROPERTIES = "SimulatorProperties" + IPropertiesContainer.PERSISTENT_PROPERTY; //$NON-NLS-1$ - - /** - * Property: Last selected simulator type - */ - public static final String PROP_SIM_TYPE = "SimulatorType" + IPropertiesContainer.PERSISTENT_PROPERTY; //$NON-NLS-1$ - - /** - * Property: Auto-start the debugger after the agent launch. - */ - public static final String PROP_AUTO_START_DEBUGGER = "autoStartDebugger" + IPropertiesContainer.PERSISTENT_PROPERTY; //$NON-NLS-1$ - - /** - * Property: Connect after the configuration has been created. - */ - public static final String PROP_AUTO_CONNECT = "autoConnect"; //$NON-NLS-1$ } diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/internal/PeerModelPropertyTester.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/internal/PeerModelPropertyTester.java index e250b1d1a..482937473 100644 --- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/internal/PeerModelPropertyTester.java +++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/internal/PeerModelPropertyTester.java @@ -123,14 +123,14 @@ public class PeerModelPropertyTester extends PropertyTester { } if ("isOfType".equals(property)) { //$NON-NLS-1$ - String value = peer.getAttributes().get(IPeerNodeProperties.PROP_TYPE); + String value = peer.getAttributes().get(IPeerProperties.PROP_TYPE); if (expectedValue instanceof String) { return value != null ? ((String)expectedValue).equals(value) : ((String)expectedValue).equalsIgnoreCase("null"); //$NON-NLS-1$ } } if ("containsPlatform".equals(property)) { //$NON-NLS-1$ - String value = peer.getAttributes().get(IPeerProperties.ATTR_PLATFORMS); + String value = peer.getAttributes().get(IPeerProperties.PROP_PLATFORMS); if (value != null) { String[] platforms = value.split("\\s*,\\s*"); //$NON-NLS-1$ for (String platform : platforms) { @@ -165,7 +165,7 @@ public class PeerModelPropertyTester extends PropertyTester { } if ("hasOfflineService".equals(property)) { //$NON-NLS-1$ - String offlineServices = peer.getAttributes().get(IPeerNodeProperties.PROP_OFFLINE_SERVICES); + String offlineServices = peer.getAttributes().get(IPeerProperties.PROP_OFFLINE_SERVICES); String remoteServices = peerNode.getStringProperty(IPeerNodeProperties.PROP_REMOTE_SERVICES); List<String> offline = offlineServices != null ? Arrays.asList(offlineServices.split(",\\s*")) : Collections.EMPTY_LIST; //$NON-NLS-1$ List<String> remote = remoteServices != null ? Arrays.asList(remoteServices.split(",\\s*")) : null; //$NON-NLS-1$ diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/iterators/StartDebuggerIterator.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/iterators/StartDebuggerIterator.java index a3d8186c7..0271008f2 100644 --- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/iterators/StartDebuggerIterator.java +++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/iterators/StartDebuggerIterator.java @@ -19,9 +19,9 @@ import org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer; import org.eclipse.tcf.te.runtime.stepper.StepperAttributeUtil; import org.eclipse.tcf.te.runtime.stepper.interfaces.IFullQualifiedId; import org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext; +import org.eclipse.tcf.te.tcf.core.interfaces.IPeerProperties; import org.eclipse.tcf.te.tcf.locator.interfaces.IStepAttributes; import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode; -import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNodeProperties; /** * Step group iterator for debugger attach. @@ -48,7 +48,7 @@ public class StartDebuggerIterator extends AbstractPeerNodeStepGroupIterator { Runnable runnable = new Runnable() { @Override public void run() { - String value = node.getPeer().getAttributes().get(IPeerNodeProperties.PROP_AUTO_START_DEBUGGER); + String value = node.getPeer().getAttributes().get(IPeerProperties.PROP_AUTO_START_DEBUGGER); autoStartDbg.set(value != null ? Boolean.parseBoolean(value) : false); } }; diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/nodes/PeerNode.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/nodes/PeerNode.java index 52c8804cd..5d6c13675 100644 --- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/nodes/PeerNode.java +++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/nodes/PeerNode.java @@ -40,6 +40,7 @@ import org.eclipse.tcf.te.runtime.services.interfaces.ISimulatorService; import org.eclipse.tcf.te.runtime.stepper.interfaces.IStepperOperationService; import org.eclipse.tcf.te.runtime.stepper.utils.StepperHelper; import org.eclipse.tcf.te.runtime.utils.StatusHelper; +import org.eclipse.tcf.te.tcf.core.interfaces.IPeerProperties; import org.eclipse.tcf.te.tcf.locator.activator.CoreBundleActivator; import org.eclipse.tcf.te.tcf.locator.interfaces.IStepperServiceOperations; import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel; @@ -309,8 +310,8 @@ public class PeerNode extends ContainerModelNode implements IPeerNode, IPeerNode @Override public boolean isVisible() { IPeer peer = getPeer(); - boolean visible = peer != null && peer.getAttributes().containsKey(IPeerNodeProperties.PROP_VISIBLE) - ? Boolean.valueOf(peer.getAttributes().get(IPeerNodeProperties.PROP_VISIBLE)).booleanValue() : true; + boolean visible = peer != null && peer.getAttributes().containsKey(IPeerProperties.PROP_VISIBLE) + ? Boolean.valueOf(peer.getAttributes().get(IPeerProperties.PROP_VISIBLE)).booleanValue() : true; if (visible) { IService[] services = ServiceManager.getInstance().getServices(this, IDelegateService.class, false); if (services != null && services.length > 0) { @@ -353,7 +354,7 @@ public class PeerNode extends ContainerModelNode implements IPeerNode, IPeerNode Protocol.invokeAndWait(new Runnable() { @Override public void run() { - type.set(getPeer().getAttributes().get(IPeerNodeProperties.PROP_TYPE)); + type.set(getPeer().getAttributes().get(IPeerProperties.PROP_TYPE)); } }); return type.get(); diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/services/PeerModelQueryService.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/services/PeerModelQueryService.java index 69a48b86e..0f79f5b7a 100644 --- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/services/PeerModelQueryService.java +++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/services/PeerModelQueryService.java @@ -15,6 +15,7 @@ import java.util.concurrent.atomic.AtomicReference; import org.eclipse.core.runtime.Assert; import org.eclipse.tcf.protocol.Protocol; +import org.eclipse.tcf.te.tcf.core.interfaces.IPeerProperties; import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel; import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode; import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNodeProperties; @@ -89,7 +90,7 @@ public class PeerModelQueryService extends AbstractPeerModelService implements I Protocol.invokeAndWait(new Runnable() { @Override public void run() { - services.set(node.getPeer().getAttributes().get(IPeerNodeProperties.PROP_OFFLINE_SERVICES)); + services.set(node.getPeer().getAttributes().get(IPeerProperties.PROP_OFFLINE_SERVICES)); } }); diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/services/PropertiesAccessService.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/services/PropertiesAccessService.java index 51ddaf85e..1b250060c 100644 --- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/services/PropertiesAccessService.java +++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/services/PropertiesAccessService.java @@ -15,7 +15,6 @@ import java.util.Map; import org.eclipse.tcf.protocol.IPeer; import org.eclipse.tcf.protocol.Protocol; -import org.eclipse.tcf.te.core.nodes.interfaces.wire.IWireTypeNetwork; import org.eclipse.tcf.te.runtime.services.interfaces.constants.IPropertiesAccessServiceConstants; import org.eclipse.tcf.te.tcf.core.interfaces.IPeerProperties; import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode; @@ -73,7 +72,7 @@ public class PropertiesAccessService extends org.eclipse.tcf.te.tcf.core.model.s result.put(IPropertiesAccessServiceConstants.PROP_PROXIES, value); } - value = attributes.get(IWireTypeNetwork.PROPERTY_NETWORK_PORT_IS_AUTO); + value = attributes.get(IPeerProperties.PROP_IP_PORT_IS_AUTO); if (value != null && !"".equals(value.trim())) { //$NON-NLS-1$ result.put(IPropertiesAccessServiceConstants.PROP_PORT_IS_AUTO, value); } diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/services/selection/RuntimeServiceContextFilter.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/services/selection/RuntimeServiceContextFilter.java index 42fe82c5e..8b87e492e 100644 --- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/services/selection/RuntimeServiceContextFilter.java +++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/services/selection/RuntimeServiceContextFilter.java @@ -17,6 +17,7 @@ import java.util.concurrent.atomic.AtomicBoolean; import org.eclipse.core.runtime.Assert; import org.eclipse.tcf.protocol.IPeer; import org.eclipse.tcf.protocol.Protocol; +import org.eclipse.tcf.te.tcf.core.interfaces.IPeerProperties; import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode; import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNodeProperties; import org.eclipse.tcf.te.tcf.locator.interfaces.services.IDefaultContextService; @@ -78,7 +79,7 @@ public class RuntimeServiceContextFilter implements IDefaultContextService.ICont if (useDisconnectedContexts) { final IPeer peer = peerNode.getPeer(); - services = peer.getAttributes().get(IPeerNodeProperties.PROP_OFFLINE_SERVICES); + services = peer.getAttributes().get(IPeerProperties.PROP_OFFLINE_SERVICES); list = services != null ? Arrays.asList(services.split(",\\s*")) : Collections.EMPTY_LIST; //$NON-NLS-1$ boolean containsAll = true; for (String serviceName : serviceNames) { diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/steps/CheckServiceStep.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/steps/CheckServiceStep.java index e2ab76bd5..b6c31f07a 100644 --- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/steps/CheckServiceStep.java +++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/steps/CheckServiceStep.java @@ -25,9 +25,9 @@ import org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer; import org.eclipse.tcf.te.runtime.stepper.StepperAttributeUtil; import org.eclipse.tcf.te.runtime.stepper.interfaces.IFullQualifiedId; import org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext; +import org.eclipse.tcf.te.tcf.core.interfaces.IPeerProperties; import org.eclipse.tcf.te.tcf.core.interfaces.steps.ITcfStepAttributes; import org.eclipse.tcf.te.tcf.locator.activator.CoreBundleActivator; -import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNodeProperties; /** * Check service step implementation. @@ -88,7 +88,7 @@ public class CheckServiceStep extends AbstractPeerNodeStep { } String offlineService = getParameters().get(PARAMETER_OFFLINE_SERVICE); - String services = getActivePeerContext(context, data, fullQualifiedId).getAttributes().get(IPeerNodeProperties.PROP_OFFLINE_SERVICES); + String services = getActivePeerContext(context, data, fullQualifiedId).getAttributes().get(IPeerProperties.PROP_OFFLINE_SERVICES); List<String> list = services != null ? Arrays.asList(services.split(",\\s*")) : Collections.EMPTY_LIST; //$NON-NLS-1$ if (offlineService != null && !list.contains(offlineService)) { throw new CoreException(new Status(IStatus.ERROR, CoreBundleActivator.getUniqueIdentifier(), "missing offline service '" + offlineService + "'")); //$NON-NLS-1$ //$NON-NLS-2$ diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/steps/StartPingTimerStep.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/steps/StartPingTimerStep.java index 403da42f8..28ddbbd81 100644 --- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/steps/StartPingTimerStep.java +++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/steps/StartPingTimerStep.java @@ -30,12 +30,12 @@ import org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer; import org.eclipse.tcf.te.runtime.stepper.StepperAttributeUtil; import org.eclipse.tcf.te.runtime.stepper.interfaces.IFullQualifiedId; import org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext; +import org.eclipse.tcf.te.tcf.core.interfaces.IPeerProperties; import org.eclipse.tcf.te.tcf.core.interfaces.steps.ITcfStepAttributes; import org.eclipse.tcf.te.tcf.locator.activator.CoreBundleActivator; import org.eclipse.tcf.te.tcf.locator.interfaces.IStepAttributes; import org.eclipse.tcf.te.tcf.locator.interfaces.ITracing; import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode; -import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNodeProperties; import org.eclipse.tcf.te.tcf.locator.nls.Messages; import org.eclipse.tcf.te.tcf.locator.utils.SimulatorUtils; @@ -81,9 +81,9 @@ public class StartPingTimerStep extends AbstractPeerNodeStep { Map<String, String> attrs = peerNode.getPeer().getAttributes(); int interval = 10000; - if (attrs.containsKey(IPeerNodeProperties.PROP_PING_INTERVAL)) { + if (attrs.containsKey(IPeerProperties.PROP_PING_INTERVAL)) { try { - interval = Integer.parseInt(attrs.get(IPeerNodeProperties.PROP_PING_INTERVAL)); + interval = Integer.parseInt(attrs.get(IPeerProperties.PROP_PING_INTERVAL)); interval = interval * 1000; } catch (NumberFormatException nfe) { @@ -92,9 +92,9 @@ public class StartPingTimerStep extends AbstractPeerNodeStep { pingInterval = interval; int timeout = 10000; - if (attrs.containsKey(IPeerNodeProperties.PROP_PING_TIMEOUT)) { + if (attrs.containsKey(IPeerProperties.PROP_PING_TIMEOUT)) { try { - timeout = Integer.parseInt(attrs.get(IPeerNodeProperties.PROP_PING_TIMEOUT)); + timeout = Integer.parseInt(attrs.get(IPeerProperties.PROP_PING_TIMEOUT)); timeout = timeout * 1000; } catch (NumberFormatException nfe) { diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/utils/SimulatorUtils.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/utils/SimulatorUtils.java index 0b5dc8e44..b7f6b6a71 100644 --- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/utils/SimulatorUtils.java +++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/utils/SimulatorUtils.java @@ -22,8 +22,8 @@ import org.eclipse.tcf.te.runtime.interfaces.callback.ICallback; import org.eclipse.tcf.te.runtime.services.ServiceManager; import org.eclipse.tcf.te.runtime.services.interfaces.IService; import org.eclipse.tcf.te.runtime.services.interfaces.ISimulatorService; +import org.eclipse.tcf.te.tcf.core.interfaces.IPeerProperties; import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode; -import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNodeProperties; /** * Simulator related utilities. @@ -53,9 +53,9 @@ public final class SimulatorUtils { Runnable runnable = new Runnable() { @Override public void run() { - String value = peerNode.getPeer().getAttributes().get(IPeerNodeProperties.PROP_SIM_ENABLED); - if (value != null) { - isEnabled.set(Boolean.parseBoolean(value)); + String subType = peerNode.getPeer().getAttributes().get(IPeerProperties.PROP_SUBTYPE); + if (subType != null) { + isEnabled.set(subType.equals(IPeerProperties.SUBTYPE_SIM)); } } }; @@ -81,15 +81,8 @@ public final class SimulatorUtils { IPeer peer = peerNode.getPeer(); if (peer != null) { - boolean isEnabled = false; - - String value = peer.getAttributes().get(IPeerNodeProperties.PROP_SIM_ENABLED); - if (value != null) isEnabled = Boolean.parseBoolean(value); - - String type = peer.getAttributes().get(IPeerNodeProperties.PROP_SIM_TYPE); - String properties = peer.getAttributes().get(IPeerNodeProperties.PROP_SIM_PROPERTIES); - - if (isEnabled) { + if (isSimulatorEnabled(peerNode)) { + String type = peer.getAttributes().get(IPeerProperties.PROP_SIM_TYPE); IService[] services = ServiceManager.getInstance().getServices(peerNode, ISimulatorService.class, false); for (IService service : services) { Assert.isTrue(service instanceof ISimulatorService); @@ -99,7 +92,7 @@ public final class SimulatorUtils { result = new Result(); result.service = (ISimulatorService)service; result.id = id; - result.settings = properties; + result.settings = peer.getAttributes().get(IPeerProperties.PROP_SIM_PROPERTIES); break; } } @@ -110,6 +103,30 @@ public final class SimulatorUtils { } /** + * Returns the simulator service and the settings for the simulator launch. + * If no simulator service is configured in the peer + * or the configured service is not available, <code>null</code> will be returned. + * + * @param peerNode The peer model node. Must not be <code>null</code>. + * @return The {@link Result} containing the simulator service and the settings or <code>null</code>. + */ + public static ISimulatorService getSimulatorService(final Object context, final String type) { + Assert.isNotNull(context); + + IService[] services = ServiceManager.getInstance().getServices(context, ISimulatorService.class, false); + for (IService service : services) { + Assert.isTrue(service instanceof ISimulatorService); + // Get the UI service which is associated with the simulator service + String id = service.getId(); + if (id != null && id.equals(type)) { + return (ISimulatorService)service; + } + } + + return null; + } + + /** * Starts the simulator if the simulator launch is enabled for the given peer * model node and the configured simulator service type is available. In any * other cases, the given callback is invoked immediately. diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/controls/TcpTransportPanel.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/controls/TcpTransportPanel.java index d6e99405c..5440df6a1 100644 --- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/controls/TcpTransportPanel.java +++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/controls/TcpTransportPanel.java @@ -14,8 +14,8 @@ import org.eclipse.swt.events.ModifyEvent; import org.eclipse.swt.events.ModifyListener; import org.eclipse.swt.events.TypedEvent; import org.eclipse.tcf.protocol.IPeer; -import org.eclipse.tcf.te.core.nodes.interfaces.wire.IWireTypeNetwork; import org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer; +import org.eclipse.tcf.te.tcf.core.interfaces.IPeerProperties; import org.eclipse.tcf.te.tcf.ui.nls.Messages; import org.eclipse.tcf.te.ui.controls.BaseDialogPageControl; import org.eclipse.tcf.te.ui.controls.validator.NameOrIPValidator; @@ -143,7 +143,7 @@ public class TcpTransportPanel extends NetworkCablePanel { isDirty |= !port.equals(oldPort != null ? oldPort : ""); //$NON-NLS-1$ } - boolean autoPort = data.getBooleanProperty(IWireTypeNetwork.PROPERTY_NETWORK_PORT_IS_AUTO); + boolean autoPort = data.getBooleanProperty(IPeerProperties.PROP_IP_PORT_IS_AUTO); isDirty |= isAutoPort() != autoPort; return isDirty; @@ -156,7 +156,7 @@ public class TcpTransportPanel extends NetworkCablePanel { public void setupData(IPropertiesContainer data) { if (data == null) return; - boolean isAutoPort = data.getBooleanProperty(IWireTypeNetwork.PROPERTY_NETWORK_PORT_IS_AUTO); + boolean isAutoPort = data.getBooleanProperty(IPeerProperties.PROP_IP_PORT_IS_AUTO); NetworkAddressControl addressControl = getAddressControl(); if (addressControl != null) { @@ -199,9 +199,9 @@ public class TcpTransportPanel extends NetworkCablePanel { } if (isAutoPort) { - data.setProperty(IWireTypeNetwork.PROPERTY_NETWORK_PORT_IS_AUTO, Boolean.TRUE.toString()); + data.setProperty(IPeerProperties.PROP_IP_PORT_IS_AUTO, Boolean.TRUE.toString()); } else { - data.setProperty(IWireTypeNetwork.PROPERTY_NETWORK_PORT_IS_AUTO, null); + data.setProperty(IPeerProperties.PROP_IP_PORT_IS_AUTO, null); } } @@ -213,7 +213,7 @@ public class TcpTransportPanel extends NetworkCablePanel { if (data == null) return; data.setProperty(IPeer.ATTR_IP_HOST, null); data.setProperty(IPeer.ATTR_IP_PORT, null); - data.setProperty(IWireTypeNetwork.PROPERTY_NETWORK_PORT_IS_AUTO, null); + data.setProperty(IPeerProperties.PROP_IP_PORT_IS_AUTO, null); } /* (non-Javadoc) @@ -225,6 +225,6 @@ public class TcpTransportPanel extends NetworkCablePanel { Assert.isNotNull(dst); dst.setProperty(IPeer.ATTR_IP_HOST, src.getStringProperty(IPeer.ATTR_IP_HOST)); dst.setProperty(IPeer.ATTR_IP_PORT, src.getStringProperty(IPeer.ATTR_IP_PORT)); - dst.setProperty(IWireTypeNetwork.PROPERTY_NETWORK_PORT_IS_AUTO, src.getStringProperty(IWireTypeNetwork.PROPERTY_NETWORK_PORT_IS_AUTO)); + dst.setProperty(IPeerProperties.PROP_IP_PORT_IS_AUTO, src.getStringProperty(IPeerProperties.PROP_IP_PORT_IS_AUTO)); } } diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/dialogs/ActionHistorySelectionDialog.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/dialogs/ActionHistorySelectionDialog.java index e4f7fdaa5..84fa60a8b 100644 --- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/dialogs/ActionHistorySelectionDialog.java +++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/dialogs/ActionHistorySelectionDialog.java @@ -313,18 +313,11 @@ public class ActionHistorySelectionDialog extends AbstractArraySelectionDialog { @Override protected IBaseLabelProvider getLabelProvider() { return new CellLabelProvider() { - /* (non-Javadoc) - * @see org.eclipse.jface.viewers.CellLabelProvider#update(org.eclipse.jface.viewers.ViewerCell) - */ @Override public void update(ViewerCell cell) { cell.setText(" " + getText(cell.getElement())); //$NON-NLS-1$ cell.setImage(getImage(cell.getElement())); } - - /* (non-Javadoc) - * @see org.eclipse.jface.viewers.CellLabelProvider#getToolTipText(java.lang.Object) - */ @Override public String getToolTipText(Object element) { Entry entry = (Entry)element; diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/dialogs/PeerNodeSelectionDialog.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/dialogs/PeerNodeSelectionDialog.java index 5abf99974..a1ce95e34 100644 --- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/dialogs/PeerNodeSelectionDialog.java +++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/dialogs/PeerNodeSelectionDialog.java @@ -19,6 +19,7 @@ import org.eclipse.jface.viewers.ISelection; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Shell; import org.eclipse.tcf.protocol.Protocol; +import org.eclipse.tcf.te.tcf.core.interfaces.IPeerProperties; import org.eclipse.tcf.te.tcf.locator.interfaces.IPeerModelListener; import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel; import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode; @@ -75,7 +76,7 @@ public class PeerNodeSelectionDialog extends AbstractArraySelectionDialog implem Protocol.invokeAndWait(new Runnable() { @Override public void run() { - String offlineServices = peerNode.getStringProperty(IPeerNodeProperties.PROP_OFFLINE_SERVICES); + String offlineServices = peerNode.getStringProperty(IPeerProperties.PROP_OFFLINE_SERVICES); String remoteServices = peerNode.getStringProperty(IPeerNodeProperties.PROP_REMOTE_SERVICES); List<String> offline = offlineServices != null ? Arrays.asList(offlineServices.split(",\\s*")) : Collections.EMPTY_LIST; //$NON-NLS-1$ List<String> remote = remoteServices != null ? Arrays.asList(remoteServices.split(",\\s*")) : null; //$NON-NLS-1$ diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/editor/sections/AttributesSection.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/editor/sections/AttributesSection.java index ece2c14b5..b0828ddf9 100644 --- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/editor/sections/AttributesSection.java +++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/editor/sections/AttributesSection.java @@ -26,6 +26,7 @@ import org.eclipse.tcf.protocol.Protocol; import org.eclipse.tcf.te.core.interfaces.IConnectable; import org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer; import org.eclipse.tcf.te.runtime.properties.PropertiesContainer; +import org.eclipse.tcf.te.tcf.core.interfaces.IPeerProperties; import org.eclipse.tcf.te.tcf.core.peers.Peer; import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode; import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNodeProperties; @@ -61,7 +62,7 @@ public class AttributesSection extends AbstractSection { IPeer.ATTR_NAME, IPeer.ATTR_TRANSPORT_NAME, IPeer.ATTR_IP_HOST, IPeer.ATTR_IP_PORT, "PipeName", //$NON-NLS-1$ "redirect.proxy", //$NON-NLS-1$ - IPeerNodeProperties.PROP_VISIBLE, "ClientID" //$NON-NLS-1$ + IPeerProperties.PROP_VISIBLE, "ClientID" //$NON-NLS-1$ }; /* @@ -74,7 +75,7 @@ public class AttributesSection extends AbstractSection { IPeer.ATTR_NAME, IPeer.ATTR_TRANSPORT_NAME, IPeer.ATTR_IP_HOST, IPeer.ATTR_IP_PORT, "PipeName", //$NON-NLS-1$ "redirect.proxy", //$NON-NLS-1$ - IPeerNodeProperties.PROP_VISIBLE, "ClientID" //$NON-NLS-1$ + IPeerProperties.PROP_VISIBLE, "ClientID" //$NON-NLS-1$ }; /** diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/editor/sections/TcpTransportSection.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/editor/sections/TcpTransportSection.java index f24f314f6..af37fe563 100644 --- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/editor/sections/TcpTransportSection.java +++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/editor/sections/TcpTransportSection.java @@ -28,7 +28,6 @@ import org.eclipse.tcf.protocol.IChannel; import org.eclipse.tcf.protocol.IPeer; import org.eclipse.tcf.protocol.Protocol; import org.eclipse.tcf.te.core.interfaces.IConnectable; -import org.eclipse.tcf.te.core.nodes.interfaces.wire.IWireTypeNetwork; import org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer; import org.eclipse.tcf.te.runtime.properties.PropertiesContainer; import org.eclipse.tcf.te.tcf.core.Tcf; @@ -355,7 +354,7 @@ public class TcpTransportSection extends AbstractSection implements IDataExchang // Mark the control update as in-progress now setIsUpdating(true); - boolean isAutoPort = data.getBooleanProperty(IWireTypeNetwork.PROPERTY_NETWORK_PORT_IS_AUTO); + boolean isAutoPort = data.getBooleanProperty(IPeerProperties.PROP_IP_PORT_IS_AUTO); if (proxyControl != null) { proxies = data.getStringProperty(IPeerProperties.PROP_PROXIES); @@ -453,7 +452,7 @@ public class TcpTransportSection extends AbstractSection implements IDataExchang odc.setProperty(IPeer.ATTR_TRANSPORT_NAME, node.getPeer().getTransportName()); odc.setProperty(IPeer.ATTR_IP_HOST, node.getPeer().getAttributes().get(IPeer.ATTR_IP_HOST)); odc.setProperty(IPeer.ATTR_IP_PORT, node.getPeer().getAttributes().get(IPeer.ATTR_IP_PORT)); - odc.setProperty(IWireTypeNetwork.PROPERTY_NETWORK_PORT_IS_AUTO, node.getPeer().getAttributes().get(IWireTypeNetwork.PROPERTY_NETWORK_PORT_IS_AUTO)); + odc.setProperty(IPeerProperties.PROP_IP_PORT_IS_AUTO, node.getPeer().getAttributes().get(IPeerProperties.PROP_IP_PORT_IS_AUTO)); odc.setProperty(IPeerProperties.PROP_PROXIES, node.getPeer().getAttributes().get(IPeerProperties.PROP_PROXIES)); // Initially, the working copy is a duplicate of the original data copy @@ -505,9 +504,9 @@ public class TcpTransportSection extends AbstractSection implements IDataExchang } if (isAutoPort) { - data.setProperty(IWireTypeNetwork.PROPERTY_NETWORK_PORT_IS_AUTO, Boolean.TRUE.toString()); + data.setProperty(IPeerProperties.PROP_IP_PORT_IS_AUTO, Boolean.TRUE.toString()); } else { - data.setProperty(IWireTypeNetwork.PROPERTY_NETWORK_PORT_IS_AUTO, null); + data.setProperty(IPeerProperties.PROP_IP_PORT_IS_AUTO, null); } // Transport name is always "TCP" @@ -675,7 +674,7 @@ public class TcpTransportSection extends AbstractSection implements IDataExchang } } - boolean autoPort = odc.getBooleanProperty(IWireTypeNetwork.PROPERTY_NETWORK_PORT_IS_AUTO); + boolean autoPort = odc.getBooleanProperty(IPeerProperties.PROP_IP_PORT_IS_AUTO); if (!autoPort && portControl != null) { String port = portControl.getEditFieldControlText(); String oldPort = odc.getStringProperty(IPeer.ATTR_IP_PORT); @@ -710,7 +709,7 @@ public class TcpTransportSection extends AbstractSection implements IDataExchang attributes.setProperty(IPeerProperties.PROP_PROXIES, null); attributes.setProperty(IPeer.ATTR_IP_HOST, null); attributes.setProperty(IPeer.ATTR_IP_PORT, null); - attributes.setProperty(IWireTypeNetwork.PROPERTY_NETWORK_PORT_IS_AUTO, null); + attributes.setProperty(IPeerProperties.PROP_IP_PORT_IS_AUTO, null); extractData(attributes); } diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/handler/ConnectLocatorNodeCommandHandler.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/handler/ConnectLocatorNodeCommandHandler.java index 3c759db9b..1b37e9145 100644 --- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/handler/ConnectLocatorNodeCommandHandler.java +++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/handler/ConnectLocatorNodeCommandHandler.java @@ -16,8 +16,8 @@ import org.eclipse.core.runtime.Assert; import org.eclipse.jface.viewers.ISelection; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.jface.wizard.WizardDialog; +import org.eclipse.tcf.te.tcf.core.interfaces.IPeerProperties; import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.ILocatorNode; -import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNodeProperties; import org.eclipse.tcf.te.tcf.ui.nls.Messages; import org.eclipse.tcf.te.ui.help.IContextHelpIds; import org.eclipse.tcf.te.ui.wizards.newWizard.NewWizard; @@ -55,7 +55,7 @@ public class ConnectLocatorNodeCommandHandler extends AbstractHandler { Object element = ((IStructuredSelection)selection).getFirstElement(); // The element must be of type IPeer if (element instanceof ILocatorNode) { - System.setProperty("NewWizard_" + IPeerNodeProperties.PROP_AUTO_CONNECT, Boolean.TRUE.toString()); //$NON-NLS-1$ + System.setProperty("NewWizard_" + IPeerProperties.PROP_AUTO_CONNECT, Boolean.TRUE.toString()); //$NON-NLS-1$ // Get the list of enabled new wizards IWorkbenchPart part = HandlerUtil.getActivePart(event); @@ -79,7 +79,7 @@ public class ConnectLocatorNodeCommandHandler extends AbstractHandler { } } - System.clearProperty("NewWizard_" + org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNodeProperties.PROP_AUTO_CONNECT); //$NON-NLS-1$ + System.clearProperty("NewWizard_" + IPeerProperties.PROP_AUTO_CONNECT); //$NON-NLS-1$ } } diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/internal/tabbed/PeerNodePropertiesSectionContentProvider.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/internal/tabbed/PeerNodePropertiesSectionContentProvider.java index 9029420c9..78bb43bb4 100644 --- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/internal/tabbed/PeerNodePropertiesSectionContentProvider.java +++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/internal/tabbed/PeerNodePropertiesSectionContentProvider.java @@ -10,6 +10,8 @@ package org.eclipse.tcf.te.tcf.ui.internal.tabbed; import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -24,10 +26,13 @@ import org.eclipse.osgi.util.NLS; import org.eclipse.swt.SWTException; import org.eclipse.swt.widgets.Control; import org.eclipse.tcf.protocol.Protocol; +import org.eclipse.tcf.te.core.interfaces.IConnectable; +import org.eclipse.tcf.te.core.utils.ConnectStateHelper; import org.eclipse.tcf.te.runtime.services.ServiceManager; import org.eclipse.tcf.te.runtime.services.interfaces.IUIService; import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode; -import org.eclipse.tcf.te.ui.interfaces.services.INodePropertiesTableFilterUIDelegate; +import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNodeProperties; +import org.eclipse.tcf.te.ui.interfaces.services.INodePropertiesTableUIDelegate; import org.eclipse.tcf.te.ui.tables.properties.NodePropertiesTableTableNode; import org.eclipse.tcf.te.ui.views.extensions.LabelProviderDelegateExtensionPointManager; import org.eclipse.ui.forms.widgets.Section; @@ -79,18 +84,26 @@ public class PeerNodePropertiesSectionContentProvider implements IStructuredCont Protocol.invokeAndWait(new Runnable() { @Override public void run() { - properties.putAll(((IPeerNode)inputElement).getPeer().getAttributes()); + IPeerNode peerNode = (IPeerNode)inputElement; + properties.putAll(peerNode.getPeer().getAttributes()); + properties.put(IPeerNodeProperties.PROP_CONNECT_STATE, ConnectStateHelper.getConnectState(peerNode.getConnectState())); + if (peerNode.getConnectState() == IConnectable.STATE_CONNECTED) { + properties.put(IPeerNodeProperties.PROP_LOCAL_SERVICES, peerNode.getStringProperty(IPeerNodeProperties.PROP_LOCAL_SERVICES)); + properties.put(IPeerNodeProperties.PROP_REMOTE_SERVICES, peerNode.getStringProperty(IPeerNodeProperties.PROP_REMOTE_SERVICES)); + } } }); } - INodePropertiesTableFilterUIDelegate filterDelegate = service != null ? service.getDelegate(inputElement, INodePropertiesTableFilterUIDelegate.class) : null; + INodePropertiesTableUIDelegate delegate = service != null ? service.getDelegate(inputElement, INodePropertiesTableUIDelegate.class) : null; for (Entry<String, Object> entry : properties.entrySet()) { String name = entry.getKey(); // Check if the property is filtered - if (name.endsWith(".silent") || name.contains(".transient")) continue; //$NON-NLS-1$ //$NON-NLS-2$ - if (filterDelegate != null && filterDelegate.isFiltered(inputElement, name, entry.getValue())) continue; + if (name.endsWith(".silent") || name.contains(".transient")) { //$NON-NLS-1$ //$NON-NLS-2$ + continue; + } + if (delegate != null && delegate.isFiltered(inputElement, name, entry.getValue())) continue; // Create the properties node NodePropertiesTableTableNode propertiesNode = new NodePropertiesTableTableNode(name, entry.getValue() != null ? entry.getValue().toString() : ""); //$NON-NLS-1$ @@ -116,6 +129,13 @@ public class PeerNodePropertiesSectionContentProvider implements IStructuredCont // Add the properties node nodes.add(propertiesNode); } + Collections.sort(nodes, new Comparator<NodePropertiesTableTableNode>() { + @Override + public int compare(NodePropertiesTableTableNode arg0, NodePropertiesTableTableNode arg1) { + return arg0.name.compareToIgnoreCase(arg1.name); + } + }); + if (delegate != null) delegate.expandNodesAfterSort(nodes); } return nodes.toArray(new NodePropertiesTableTableNode[nodes.size()]); diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/navigator/filter/GenericFilter.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/navigator/filter/GenericFilter.java index f3adb75a2..798080e81 100644 --- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/navigator/filter/GenericFilter.java +++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/navigator/filter/GenericFilter.java @@ -15,9 +15,9 @@ import org.eclipse.jface.viewers.TreePath; import org.eclipse.jface.viewers.Viewer; import org.eclipse.jface.viewers.ViewerFilter; import org.eclipse.tcf.protocol.Protocol; +import org.eclipse.tcf.te.tcf.core.interfaces.IPeerProperties; import org.eclipse.tcf.te.tcf.core.interfaces.IPeerType; import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode; -import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNodeProperties; import org.eclipse.tcf.te.ui.views.interfaces.ICategory; import org.eclipse.tcf.te.ui.views.interfaces.IUIConstants; @@ -39,7 +39,7 @@ public class GenericFilter extends ViewerFilter { Runnable runnable = new Runnable() { @Override public void run() { - type.set(((IPeerNode)element).getPeer().getAttributes().get(IPeerNodeProperties.PROP_TYPE)); + type.set(((IPeerNode)element).getPeer().getAttributes().get(IPeerProperties.PROP_TYPE)); } }; 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 fed41adca..5721da653 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 @@ -17,7 +17,7 @@ import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Text; import org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer; -import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNodeProperties; +import org.eclipse.tcf.te.tcf.core.interfaces.IPeerProperties; import org.eclipse.tcf.te.tcf.ui.nls.Messages; import org.eclipse.tcf.te.ui.controls.validator.NumberVerifyListener; import org.eclipse.tcf.te.ui.forms.parts.AbstractSection; @@ -94,7 +94,7 @@ public class PingTimeoutSection extends AbstractSection implements IDataExchange Assert.isNotNull(attributes); if (verbosity != null) { - int timeout = attributes.getIntProperty(IPeerNodeProperties.PROP_PING_TIMEOUT); + int timeout = attributes.getIntProperty(IPeerProperties.PROP_PING_TIMEOUT); if (timeout >= 0) { SWTControlUtil.setText(verbosity, timeout+""); //$NON-NLS-1$ } @@ -115,7 +115,7 @@ public class PingTimeoutSection extends AbstractSection implements IDataExchange String value = SWTControlUtil.getText(verbosity); if (value != null && !"".equals(value)) { //$NON-NLS-1$ - attributes.setProperty(IPeerNodeProperties.PROP_PING_TIMEOUT, value); + attributes.setProperty(IPeerProperties.PROP_PING_TIMEOUT, value); } } diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/AbstractNewConfigWizard.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/AbstractNewConfigWizard.java index 625cd5b4c..0ce4921a8 100644 --- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/AbstractNewConfigWizard.java +++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/AbstractNewConfigWizard.java @@ -17,8 +17,8 @@ import org.eclipse.tcf.protocol.Protocol; import org.eclipse.tcf.te.core.interfaces.IConnectable; import org.eclipse.tcf.te.runtime.services.ServiceManager; import org.eclipse.tcf.te.tcf.core.interfaces.IPathMapService; +import org.eclipse.tcf.te.tcf.core.interfaces.IPeerProperties; import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode; -import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNodeProperties; import org.eclipse.tcf.te.tcf.locator.interfaces.services.IDefaultContextService; import org.eclipse.tcf.te.tcf.ui.activator.UIPlugin; import org.eclipse.tcf.te.ui.wizards.AbstractWizard; @@ -82,7 +82,7 @@ public abstract class AbstractNewConfigWizard extends AbstractWizard implements Protocol.invokeAndWait(new Runnable() { @Override public void run() { - connect.set(Boolean.parseBoolean(peerNode.getPeer().getAttributes().get(IPeerNodeProperties.PROP_AUTO_CONNECT))); + connect.set(Boolean.parseBoolean(peerNode.getPeer().getAttributes().get(IPeerProperties.PROP_AUTO_CONNECT))); } }); 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 043ac42ad..57168ca5d 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 @@ -36,7 +36,6 @@ import org.eclipse.tcf.te.tcf.core.interfaces.IPeerProperties; import org.eclipse.tcf.te.tcf.core.peers.Peer; import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.ILocatorNode; import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode; -import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNodeProperties; 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; @@ -82,7 +81,7 @@ public class NewWizard extends AbstractNewConfigWizard { key.equals(IPeer.ATTR_IP_HOST) || key.equals(IPeer.ATTR_IP_PORT) || key.equals(IPeerProperties.PROP_PROXIES) || - key.equals(IPeerNodeProperties.PROP_AUTO_CONNECT); + key.equals(IPeerProperties.PROP_AUTO_CONNECT); } /* (non-Javadoc) @@ -109,7 +108,7 @@ public class NewWizard extends AbstractNewConfigWizard { } if (peer != null) { - String selPeerType = peer.getAttributes().get(IPeerNodeProperties.PROP_TYPE); + 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(); diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/pages/AbstractConfigWizardPage.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/pages/AbstractConfigWizardPage.java index b808f6a1a..33504528e 100644 --- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/pages/AbstractConfigWizardPage.java +++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/pages/AbstractConfigWizardPage.java @@ -28,6 +28,7 @@ import org.eclipse.swt.widgets.Label; import org.eclipse.tcf.protocol.IPeer; import org.eclipse.tcf.protocol.Protocol; import org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer; +import org.eclipse.tcf.te.tcf.core.interfaces.IPeerProperties; import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode; import org.eclipse.tcf.te.tcf.locator.model.ModelManager; import org.eclipse.tcf.te.tcf.ui.controls.PeerNameControl; @@ -484,11 +485,11 @@ public abstract class AbstractConfigWizardPage extends AbstractFormsWizardPage i } if (isAutoStartDebugger()) { - peerAttributes.setProperty(org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNodeProperties.PROP_AUTO_START_DEBUGGER, true); + peerAttributes.setProperty(IPeerProperties.PROP_AUTO_START_DEBUGGER, true); } if (isAutoConnect()) { - peerAttributes.setProperty(org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNodeProperties.PROP_AUTO_CONNECT, true); + peerAttributes.setProperty(IPeerProperties.PROP_AUTO_CONNECT, true); } if (selectorSection != null) { diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/pages/NewTargetWizardPage.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/pages/NewTargetWizardPage.java index da9458934..e6e8ef53e 100644 --- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/pages/NewTargetWizardPage.java +++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/pages/NewTargetWizardPage.java @@ -392,8 +392,8 @@ public class NewTargetWizardPage extends AbstractValidatingWizardPage implements // Create the auto connect button if (hasAutoConnectButton()) { - if (System.getProperty("NewWizard_" + org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNodeProperties.PROP_AUTO_CONNECT) != null) { //$NON-NLS-1$ - autoConnect = Boolean.getBoolean("NewWizard_" + org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNodeProperties.PROP_AUTO_CONNECT); //$NON-NLS-1$ + if (System.getProperty("NewWizard_" + IPeerProperties.PROP_AUTO_CONNECT) != null) { //$NON-NLS-1$ + autoConnect = Boolean.getBoolean("NewWizard_" + IPeerProperties.PROP_AUTO_CONNECT); //$NON-NLS-1$ } connect = new Button(client, SWT.CHECK); @@ -612,7 +612,7 @@ public class NewTargetWizardPage extends AbstractValidatingWizardPage implements } if (isAutoConnect()) { - peerAttributes.setProperty(org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNodeProperties.PROP_AUTO_CONNECT, true); + peerAttributes.setProperty(IPeerProperties.PROP_AUTO_CONNECT, true); } } diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/BaseEditBrowseTextControl.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/BaseEditBrowseTextControl.java index 3df81a70f..be706de7d 100644 --- a/target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/BaseEditBrowseTextControl.java +++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/BaseEditBrowseTextControl.java @@ -1136,6 +1136,14 @@ public class BaseEditBrowseTextControl extends AbstractDecoratedDialogPageContro } } + public void addToEditFieldControlHistory(String entry, int index) { + if (hasHistory() && getEditFieldControl() instanceof Combo) { + Combo combo = (Combo)getEditFieldControl(); + if (entry != null && entry.trim().length() > 0 && combo.indexOf(entry) == -1) { + combo.add(entry, index >= 0 && index <= combo.getItemCount() ? index : combo.getItemCount()); + } + } + } /** * The method is called to create an edit field validator during setup. * Subclasses have to override this method to create the right validator. diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/BaseWizardConfigurationPanelControl.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/BaseWizardConfigurationPanelControl.java index dfa35373d..e577382b9 100644 --- a/target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/BaseWizardConfigurationPanelControl.java +++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/BaseWizardConfigurationPanelControl.java @@ -23,8 +23,11 @@ import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Group; import org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer; +import org.eclipse.tcf.te.runtime.properties.PropertiesContainer; import org.eclipse.tcf.te.ui.controls.interfaces.IWizardConfigurationPanel; import org.eclipse.tcf.te.ui.controls.panels.AbstractWizardConfigurationPanel; +import org.eclipse.tcf.te.ui.interfaces.data.IDataExchangeNode; +import org.eclipse.tcf.te.ui.interfaces.data.IUpdatable; import org.eclipse.ui.forms.widgets.FormToolkit; /** @@ -255,13 +258,25 @@ public class BaseWizardConfigurationPanelControl extends BaseDialogPageControl { * @param key The key to get the wizard configuration panel for. Must not be <code>null</code>! */ public void showConfigurationPanel(String key) { - IWizardConfigurationPanel configPanel = getConfigurationPanel(key); + String activeKey = getActiveConfigurationPanelKey(); + if (key != null && key.equals(activeKey)) { + return; + } + IWizardConfigurationPanel configPanel = getActiveConfigurationPanel(); + IPropertiesContainer data = new PropertiesContainer(); + if (configPanel instanceof IDataExchangeNode) { + ((IDataExchangeNode)configPanel).extractData(data); + } + configPanel = getConfigurationPanel(key); Assert.isNotNull(configPanel); if (configPanel.getControl() != null) { activeConfigurationPanel = configPanel; activeConfigurationPanelKey = key; panelLayout.topControl = configPanel.getControl(); panel.layout(); + if (!data.isEmpty() && configPanel instanceof IUpdatable) { + ((IUpdatable)configPanel).updateData(data); + } configPanel.activate(); } } diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/panels/AbstractWizardConfigurationPanel.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/panels/AbstractWizardConfigurationPanel.java index 3b4e14b7a..50a80b79d 100644 --- a/target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/panels/AbstractWizardConfigurationPanel.java +++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/panels/AbstractWizardConfigurationPanel.java @@ -26,6 +26,8 @@ public abstract class AbstractWizardConfigurationPanel implements IWizardConfigu private String message = null; private int messageType = IMessageProvider.NONE; + private boolean enabled = true; + /** * Constructor. * @@ -117,8 +119,16 @@ public abstract class AbstractWizardConfigurationPanel implements IWizardConfigu */ @Override public void setEnabled(boolean enabled) { + this.enabled = enabled; } + /** + * @return Returns the enabled state. + */ + public boolean isEnabled() { + return enabled; + } + /* (non-Javadoc) * @see org.eclipse.tcf.te.ui.controls.interfaces.IWizardConfigurationPanel#isValid() */ diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.forms/src/org/eclipse/tcf/te/ui/forms/parts/AbstractSection.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.forms/src/org/eclipse/tcf/te/ui/forms/parts/AbstractSection.java index f1cc7b93d..e685d6cbc 100644 --- a/target_explorer/plugins/org.eclipse.tcf.te.ui.forms/src/org/eclipse/tcf/te/ui/forms/parts/AbstractSection.java +++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.forms/src/org/eclipse/tcf/te/ui/forms/parts/AbstractSection.java @@ -133,8 +133,22 @@ public abstract class AbstractSection extends SectionPart implements IAdaptable, * @return The client container composite. */ protected Composite createClientContainer(Composite parent, int numColumns, FormToolkit toolkit) { + return createClientContainer(parent, numColumns, false, toolkit); + } + + /** + * Creates the client container composite. + * + * @param parent The parent composite. Must not be <code>null</code>. + * @param numColumns The number of columns. + * @param makeColumnsEqualWith + * @param toolkit The form toolkit or <code>null</code>. + * + * @return The client container composite. + */ + protected Composite createClientContainer(Composite parent, int numColumns, boolean makeColumnsEqualWith, FormToolkit toolkit) { Composite container = toolkit != null ? toolkit.createComposite(parent) : new Composite(parent, SWT.NONE); - container.setLayout(FormLayoutFactory.createSectionClientGridLayout(false, numColumns)); + container.setLayout(FormLayoutFactory.createSectionClientGridLayout(makeColumnsEqualWith, numColumns)); // Adjust the background Color bg = parent.getBackground(); diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/interfaces/services/INodePropertiesTableFilterUIDelegate.java b/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/interfaces/services/INodePropertiesTableUIDelegate.java index 36744088f..69e4be91c 100644 --- a/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/interfaces/services/INodePropertiesTableFilterUIDelegate.java +++ b/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/interfaces/services/INodePropertiesTableUIDelegate.java @@ -9,11 +9,15 @@ *******************************************************************************/ package org.eclipse.tcf.te.ui.interfaces.services; +import java.util.List; + +import org.eclipse.tcf.te.ui.tables.properties.NodePropertiesTableTableNode; + /** * Interface to be implemented by clients to filter the content of the * node properties table control. */ -public interface INodePropertiesTableFilterUIDelegate { +public interface INodePropertiesTableUIDelegate { /** * Returns if or if not the given property is filtered from the node @@ -25,5 +29,11 @@ public interface INodePropertiesTableFilterUIDelegate { * * @return <code>True</code> if the property is filtered, <code>false</code> otherwise. */ - boolean isFiltered(Object context, String name, Object value); + public boolean isFiltered(Object context, String name, Object value); + + /** + * Expand nodes after the list was generated and sorted. + * @param sortedNodes + */ + public void expandNodesAfterSort(List<NodePropertiesTableTableNode> sortedNodes); } diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/interfaces/services/ISimulatorServiceUIDelegate.java b/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/interfaces/services/ISimulatorServiceUIDelegate.java index 0e4f86a17..720b353c1 100644 --- a/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/interfaces/services/ISimulatorServiceUIDelegate.java +++ b/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/interfaces/services/ISimulatorServiceUIDelegate.java @@ -17,7 +17,9 @@ import org.eclipse.tcf.te.runtime.services.interfaces.ISimulatorService; */ public interface ISimulatorServiceUIDelegate { - public static final String PROPERTY_ADDRESS_READONLY = "addressReadOnly"; //$NON-NLS-1$ + public static final String PROP_MODES = "Modes"; //$NON-NLS-1$ + public static final String PROP_MODE_LABEL_X = "ModeLabel"; //$NON-NLS-1$ + public static final String PROP_MODE_DESCRIPTION_X = "ModeDescription"; //$NON-NLS-1$ /** * Get the simulator service the UI delegate is associated with. @@ -43,26 +45,11 @@ public interface ISimulatorServiceUIDelegate { */ public String getDescription(Object context, String config); - /** - * Configure the simulator. - * - * @param context The context for which the simulator should be configured. - * @param oldConfig The previous configuration or <code>null</code>. - * @return The new configuration or <code>null</code>. - */ - public String configure(Object context, String oldConfig); - - /** - * Get UI configuration properties. - * @param context The context. - * @param config The configuration or <code>null</code>. - * @return The UI configuration properties. - */ - public IPropertiesContainer getUIProperties(Object context, String config); - - /** - * Returns <code>true</code> if the simulator is configurable. - * @return <code>true</code> if the simulator is configurable. - */ - public boolean canConfigure(); + /** + * Get properties for ui configuration. + * @param context The conetxt. + * @param config The current config. + * @return The properties for ui configuartion + */ + public IPropertiesContainer getProperties(Object context, String config); } diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/tables/properties/NodePropertiesTableTableNode.java b/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/tables/properties/NodePropertiesTableTableNode.java index f5e3ba1bc..96f8938e6 100644 --- a/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/tables/properties/NodePropertiesTableTableNode.java +++ b/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/tables/properties/NodePropertiesTableTableNode.java @@ -39,4 +39,18 @@ public final class NodePropertiesTableTableNode extends PlatformObject { this.name = name; this.value = value; } + + /* (non-Javadoc) + * @see java.lang.Object#equals(java.lang.Object) + */ + @Override + public boolean equals(Object obj) { + boolean equals = super.equals(obj); + + if (!equals && obj instanceof NodePropertiesTableTableNode) { + return name.equals(((NodePropertiesTableTableNode)obj).name); + } + + return equals; + } } diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/wizards/AbstractWizard.java b/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/wizards/AbstractWizard.java index 2aea4c144..92f3efb3d 100644 --- a/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/wizards/AbstractWizard.java +++ b/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/wizards/AbstractWizard.java @@ -91,15 +91,17 @@ public abstract class AbstractWizard extends Wizard implements IWorkbenchWizard super.createPageControls(pageContainer); IPropertiesContainer data = getInitialData(); - if (data == null) data = new PropertiesContainer(); - for (IWizardPage page : getPages()) { - if (page instanceof IDataExchangeNode) { - ((IDataExchangeNode)page).setupData(data); - if (page instanceof AbstractValidatingWizardPage) { - ((AbstractValidatingWizardPage)page).validate(); - } + if (data == null) { + data = new PropertiesContainer(); + } + for (IWizardPage page : getPages()) { + if (page instanceof IDataExchangeNode) { + ((IDataExchangeNode)page).setupData(data); + if (page instanceof AbstractValidatingWizardPage) { + ((AbstractValidatingWizardPage)page).validate(); } } + } } /** |