From 9c70311b440b7192b6af02fd9dd5fc806492b66a Mon Sep 17 00:00:00 2001
From: Tobias Schwarz
Date: Fri, 13 Dec 2013 11:24:12 +0100
Subject: Target Explorer: remove old peer state
---
.../ui/internal/wizards/TargetSelectionPage.java | 2 +-
.../plugin.properties | 1 -
.../org.eclipse.tcf.te.tcf.locator/plugin.xml | 5 --
.../org/eclipse/tcf/te/tcf/locator/Scanner.java | 2 +-
.../tcf/te/tcf/locator/ScannerRunnable.java | 14 +---
.../tcf/locator/interfaces/nodes/IPeerModel.java | 2 +-
.../interfaces/nodes/IPeerNodeProperties.java | 35 ---------
.../listener/ChannelStateChangeListener.java | 4 -
.../te/tcf/locator/listener/LocatorListener.java | 2 +-
.../tcf/te/tcf/locator/nodes/PeerModel.java | 2 +-
.../locator/services/PeerModelLookupService.java | 10 +--
.../locator/services/PeerModelQueryService.java | 3 +-
.../locator/services/PeerModelRefreshService.java | 8 +-
.../te/tcf/locator/steps/SetWaitForReadyStep.java | 80 --------------------
.../META-INF/MANIFEST.MF | 3 +-
.../scriptpad/actions/PeersSubMenuAction.java | 20 ++---
.../org.eclipse.tcf.te.tcf.ui/plugin.properties | 1 -
.../plugins/org.eclipse.tcf.te.tcf.ui/plugin.xml | 7 --
.../eclipse/tcf/te/tcf/ui/activator/UIPlugin.java | 2 +-
.../editor/sections/GeneralInformationSection.java | 26 +------
.../ui/editor/sections/TcpTransportSection.java | 1 -
.../tcf/ui/editor/sections/TransportSection.java | 1 -
.../te/tcf/ui/filter/PeersByCurrentUserFilter.java | 7 +-
.../te/tcf/ui/filter/UnreachablePeersFilter.java | 52 -------------
.../tcf/te/tcf/ui/handler/RenameHandler.java | 2 +-
.../ui/internal/adapters/EditorSaveAsAdapter.java | 2 +-
.../tcf/te/tcf/ui/navigator/ContentProvider.java | 86 ++++++++++++----------
.../tcf/te/tcf/ui/navigator/dnd/CommonDnD.java | 2 +-
.../ui/wizards/pages/AbstractConfigWizardPage.java | 2 +-
.../tcf/ui/wizards/pages/NewTargetWizardPage.java | 2 +-
.../tcf/ui/wizards/pages/PeerExportWizardPage.java | 2 +-
.../tcf/ui/wizards/pages/PeerImportWizardPage.java | 2 +-
32 files changed, 89 insertions(+), 301 deletions(-)
delete mode 100644 target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/steps/SetWaitForReadyStep.java
delete mode 100644 target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/filter/UnreachablePeersFilter.java
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/internal/wizards/TargetSelectionPage.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/internal/wizards/TargetSelectionPage.java
index 49b36bc30..29ed9062b 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/internal/wizards/TargetSelectionPage.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/internal/wizards/TargetSelectionPage.java
@@ -101,7 +101,7 @@ public class TargetSelectionPage extends AbstractValidatingWizardPage {
// Refresh the information of remote services.
IPeerModel model = Model.getModel();
Assert.isNotNull(model);
- IPeerNode[] peers = model.getPeers();
+ IPeerNode[] peers = model.getPeerNodes();
if (peers != null) {
IPeerModelQueryService service = model.getService(IPeerModelQueryService.class);
for (IPeerNode peer : peers) {
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/plugin.properties b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/plugin.properties
index 2a7a67295..ae021d7b4 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/plugin.properties
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/plugin.properties
@@ -18,7 +18,6 @@ StartSimulatorStep.name=Start Simulator
StopSimulatorStep.name=Stop Simulator
StartDebuggerStep.name=Start Debugger
StopDebuggerStep.name=Stop Debugger
-SetWaitForReadyStep.name=Set peer waiting state
WaitForReadyStep.name=Wait until peer becomes ready
SignalPeerDisconnectedStep.name=Signal peer disconnected state
SetAsDefaultContextStep.name=Set peer as default context
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/plugin.xml b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/plugin.xml
index 71ce90d21..dc7703c96 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/plugin.xml
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/plugin.xml
@@ -173,10 +173,6 @@
id="org.eclipse.tcf.te.tcf.locator.stopDebuggerStep"
class="org.eclipse.tcf.te.tcf.locator.steps.StopDebuggerStep"
label="%StopDebuggerStep.name"/>
-
-
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/Scanner.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/Scanner.java
index a0adeaa52..a1ca4425b 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/Scanner.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/Scanner.java
@@ -98,7 +98,7 @@ public class Scanner extends Job implements IScanner {
if (monitor == null) monitor = new NullProgressMonitor();
// Get the current list of peers known to the parent model
- IPeerNode[] peers = getParentModel().getPeers();
+ IPeerNode[] peers = getParentModel().getPeerNodes();
// Do we have something to scan at all
if (peers.length > 0) {
try {
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/ScannerRunnable.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/ScannerRunnable.java
index 926d67494..829906bd4 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/ScannerRunnable.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/ScannerRunnable.java
@@ -9,7 +9,6 @@
*******************************************************************************/
package org.eclipse.tcf.te.tcf.locator;
-import java.net.ConnectException;
import java.net.InetAddress;
import java.net.SocketTimeoutException;
import java.net.UnknownHostException;
@@ -192,12 +191,7 @@ public class ScannerRunnable implements Runnable, IChannel.IChannelListener {
// Turn off change notifications temporarily
final boolean changed = peerNode.setChangeEventsEnabled(false);
- // Set the peer state property
- int counter = peerNode.getIntProperty(IPeerNodeProperties.PROP_CHANNEL_REF_COUNTER);
- if (!peerNode.isProperty(IPeerNodeProperties.PROP_STATE, IPeerNodeProperties.STATE_WAITING_FOR_READY)) {
- peerNode.setProperty(IPeerNodeProperties.PROP_STATE, counter > 0 ? IPeerNodeProperties.STATE_CONNECTED : IPeerNodeProperties.STATE_REACHABLE);
- peerNode.setProperty(IPeerNodeProperties.PROP_LAST_SCANNER_ERROR, null);
- }
+ peerNode.setProperty(IPeerNodeProperties.PROP_LAST_SCANNER_ERROR, null);
// Get the parent model from the model mode
final IPeerModel model = (IPeerModel)peerNode.getAdapter(IPeerModel.class);
@@ -491,11 +485,7 @@ public class ScannerRunnable implements Runnable, IChannel.IChannelListener {
boolean changed = peerNode.setChangeEventsEnabled(false);
peerNode.setProperty(IPeerNodeProperties.PROP_CHANNEL_REF_COUNTER, null);
- if (!peerNode.isProperty(IPeerNodeProperties.PROP_STATE, IPeerNodeProperties.STATE_WAITING_FOR_READY)) {
- boolean timeout = error instanceof SocketTimeoutException || (error instanceof ConnectException && error.getMessage() != null && error.getMessage().startsWith("Connection timed out:")); //$NON-NLS-1$
- peerNode.setProperty(IPeerNodeProperties.PROP_STATE, timeout ? IPeerNodeProperties.STATE_NOT_REACHABLE : IPeerNodeProperties.STATE_ERROR);
- peerNode.setProperty(IPeerNodeProperties.PROP_LAST_SCANNER_ERROR, error instanceof SocketTimeoutException ? null : error);
- }
+ peerNode.setProperty(IPeerNodeProperties.PROP_LAST_SCANNER_ERROR, error instanceof SocketTimeoutException ? null : error);
// Clear out previously determined services
IPeerModel model = (IPeerModel)peerNode.getAdapter(IPeerModel.class);
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/nodes/IPeerModel.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/nodes/IPeerModel.java
index 832f225e7..daf6d8218 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/nodes/IPeerModel.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/nodes/IPeerModel.java
@@ -75,7 +75,7 @@ public interface IPeerModel extends IAdaptable {
*
* @return The list of known peers or an empty list.
*/
- public IPeerNode[] getPeers();
+ public IPeerNode[] getPeerNodes();
/**
* Returns an unmodifiable list of known children for the given parent peer.
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 3e5491003..edf04d621 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
@@ -43,41 +43,6 @@ public interface IPeerNodeProperties {
*/
public static final String PROP_REDIRECT_PROXY = "redirect.proxy"; //$NON-NLS-1$
- /**
- * Property: The peer state.
- */
- public static final String PROP_STATE = "state"; //$NON-NLS-1$
-
- /**
- * Peer state: Not determined yet (unknown).
- */
- public static final int STATE_UNKNOWN = -1;
-
- /**
- * Peer state: Peer is reachable, no active communication channel is open.
- */
- public static final int STATE_REACHABLE = 0;
-
- /**
- * Peer state: Peer is reachable and an active communication channel is opened.
- */
- public static final int STATE_CONNECTED = 1;
-
- /**
- * Peer state: Peer is not reachable. Connection attempt timed out.
- */
- public static final int STATE_NOT_REACHABLE = 2;
-
- /**
- * Peer state: Peer is not reachable. Connection attempt terminated with error.
- */
- public static final int STATE_ERROR = 3;
-
- /**
- * Peer state: Peer is waiting to become ready.
- */
- public static final int STATE_WAITING_FOR_READY = 4;
-
/**
* Property: Reference counter tracking the active channels for this peer.
*/
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/listener/ChannelStateChangeListener.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/listener/ChannelStateChangeListener.java
index 6a06ca132..599383404 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/listener/ChannelStateChangeListener.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/listener/ChannelStateChangeListener.java
@@ -64,7 +64,6 @@ public class ChannelStateChangeListener implements IChannelStateChangeListener {
if (counter < 0) counter = 0;
counter++;
node.setProperty(IPeerNodeProperties.PROP_CHANNEL_REF_COUNTER, counter);
- if (counter > 0) node.setProperty(IPeerNodeProperties.PROP_STATE, IPeerNodeProperties.STATE_CONNECTED);
}
}
break;
@@ -79,9 +78,6 @@ public class ChannelStateChangeListener implements IChannelStateChangeListener {
counter--;
if (counter < 0) counter = 0;
node.setProperty(IPeerNodeProperties.PROP_CHANNEL_REF_COUNTER, counter);
- if (counter == 0 && node.isProperty(IPeerNodeProperties.PROP_STATE, IPeerNodeProperties.STATE_CONNECTED)) {
- node.setProperty(IPeerNodeProperties.PROP_STATE, IPeerNodeProperties.STATE_REACHABLE);
- }
}
}
break;
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/listener/LocatorListener.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/listener/LocatorListener.java
index 27ba6659f..81c31c723 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/listener/LocatorListener.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/listener/LocatorListener.java
@@ -115,7 +115,7 @@ public final class LocatorListener implements ILocator.LocatorListener {
// static peers with unknown link state, refresh the agent ID's first.
List nodes = new ArrayList();
- for (IPeerNode node : model.getPeers()) {
+ for (IPeerNode node : model.getPeerNodes()) {
// We expect the agent ID to be set
if (node.getPeer().getAgentID() == null || "".equals(node.getPeer().getAgentID())) { //$NON-NLS-1$
nodes.add(node);
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/nodes/PeerModel.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/nodes/PeerModel.java
index 19d9e40af..594031ffd 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/nodes/PeerModel.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/nodes/PeerModel.java
@@ -189,7 +189,7 @@ public class PeerModel extends PlatformObject implements IPeerModel {
* @see org.eclipse.tcf.te.tcf.locator.core.interfaces.nodes.ILocatorModel#getPeers()
*/
@Override
- public IPeerNode[] getPeers() {
+ public IPeerNode[] getPeerNodes() {
final AtomicReference result = new AtomicReference();
Runnable runnable = new Runnable() {
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/services/PeerModelLookupService.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/services/PeerModelLookupService.java
index b21e4f898..2dbca2eef 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/services/PeerModelLookupService.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/services/PeerModelLookupService.java
@@ -44,7 +44,7 @@ public class PeerModelLookupService extends AbstractPeerModelService implements
Assert.isTrue(Protocol.isDispatchThread(), "Illegal Thread Access"); //$NON-NLS-1$
IPeerNode node = null;
- for (IPeerNode candidate : getPeerModel().getPeers()) {
+ for (IPeerNode candidate : getPeerModel().getPeerNodes()) {
IPeer peer = candidate.getPeer();
if (id.equals(peer.getID())) {
node = candidate;
@@ -93,7 +93,7 @@ public class PeerModelLookupService extends AbstractPeerModelService implements
Assert.isTrue(Protocol.isDispatchThread(), "Illegal Thread Access"); //$NON-NLS-1$
List nodes = new ArrayList();
- for (IPeerNode candidate : getPeerModel().getPeers()) {
+ for (IPeerNode candidate : getPeerModel().getPeerNodes()) {
IPeer peer = candidate.getPeer();
if (agentId.equals(peer.getAgentID())) {
nodes.add(candidate);
@@ -132,7 +132,7 @@ public class PeerModelLookupService extends AbstractPeerModelService implements
Assert.isTrue(Protocol.isDispatchThread(), "Illegal Thread Access"); //$NON-NLS-1$
List nodes = new ArrayList();
- for (IPeerNode candidate : getPeerModel().getPeers()) {
+ for (IPeerNode candidate : getPeerModel().getPeerNodes()) {
IPeer peer = candidate.getPeer();
if (name.equals(peer.getName())) {
nodes.add(candidate);
@@ -153,7 +153,7 @@ public class PeerModelLookupService extends AbstractPeerModelService implements
IPeerModelQueryService queryService = model.getService(IPeerModelQueryService.class);
List nodes = new ArrayList();
- for (IPeerNode candidate : model.getPeers()) {
+ for (IPeerNode candidate : model.getPeerNodes()) {
String services = queryService.queryLocalServices(candidate);
boolean matchesExpectations = true;
@@ -216,7 +216,7 @@ public class PeerModelLookupService extends AbstractPeerModelService implements
List nodes = new ArrayList();
if (peer != null) {
- for (IPeerNode candidate : getPeerModel().getPeers()) {
+ for (IPeerNode candidate : getPeerModel().getPeerNodes()) {
// If the agent id is available, match up the agent id first.
if (candidate.getPeer().getAgentID() != null && candidate.getPeer().getAgentID().equals(peer.getAgentID())) {
nodes.add(candidate);
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 51f3cd282..3e5cda423 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
@@ -204,8 +204,7 @@ public class PeerModelQueryService extends AbstractPeerModelService implements I
};
// Do not try to open a channel to peers known to be unreachable
- int state = node.getIntProperty(IPeerNodeProperties.PROP_STATE);
- if (state == IPeerNodeProperties.STATE_ERROR || state == IPeerNodeProperties.STATE_NOT_REACHABLE || !node.isComplete()) {
+ if (!node.isComplete()) {
innerDone.doneQueryServices(null);
return;
}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/services/PeerModelRefreshService.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/services/PeerModelRefreshService.java
index ba31a6891..9c6c75306 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/services/PeerModelRefreshService.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/services/PeerModelRefreshService.java
@@ -111,7 +111,7 @@ public class PeerModelRefreshService extends AbstractPeerModelService implements
}
// Get the list of old children (update node instances where possible)
- final List oldChildren = new ArrayList(Arrays.asList(model.getPeers()));
+ final List oldChildren = new ArrayList(Arrays.asList(model.getPeerNodes()));
// Refresh the static peer definitions
refreshStaticPeers(oldChildren, model);
@@ -182,7 +182,7 @@ public class PeerModelRefreshService extends AbstractPeerModelService implements
// there exist an dynamically discovered node with a different id but
// for the same peer. Do this check only if the peer to add is a static one.
IPeerNode toRemove = null;
- for (IPeerNode candidate : model.getPeers()) {
+ for (IPeerNode candidate : model.getPeerNodes()) {
if (candidate.equals(peerNode))continue;
String peerID = peerNode.getPeerId();
String clientID = candidate.getPeer().getAttributes().get("ClientID"); //$NON-NLS-1$
@@ -272,7 +272,7 @@ public class PeerModelRefreshService extends AbstractPeerModelService implements
}
// Get the list of old children (update node instances where possible)
- final List oldChildren = new ArrayList(Arrays.asList(model.getPeers()));
+ final List oldChildren = new ArrayList(Arrays.asList(model.getPeerNodes()));
// Refresh the static peer definitions
refreshStaticPeers(oldChildren, model);
@@ -516,7 +516,7 @@ public class PeerModelRefreshService extends AbstractPeerModelService implements
}, new CallbackInvocationDelegate());
// Make a copy of the current list of static peers before processing
- List nodesToProcess = new ArrayList(Arrays.asList(nodes != null ? nodes : model.getPeers()));
+ List nodesToProcess = new ArrayList(Arrays.asList(nodes != null ? nodes : model.getPeerNodes()));
// Loop the list of static peers and try to get the agent ID
for (IPeerNode node : nodesToProcess) {
// If not static or not complete --> ignore
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/steps/SetWaitForReadyStep.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/steps/SetWaitForReadyStep.java
deleted file mode 100644
index 369a2b4e1..000000000
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/steps/SetWaitForReadyStep.java
+++ /dev/null
@@ -1,80 +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.tcf.locator.steps;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.tcf.protocol.Protocol;
-import org.eclipse.tcf.te.runtime.interfaces.callback.ICallback;
-import org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer;
-import org.eclipse.tcf.te.runtime.stepper.interfaces.IFullQualifiedId;
-import org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext;
-import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNodeProperties;
-
-/**
- * Set the waiting_for_ready state.
- */
-public class SetWaitForReadyStep extends AbstractPeerNodeStep {
-
- /**
- * Constructor.
- */
- public SetWaitForReadyStep() {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.stepper.interfaces.IStep#validateExecute(org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext, org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer, org.eclipse.tcf.te.runtime.stepper.interfaces.IFullQualifiedId, org.eclipse.core.runtime.IProgressMonitor)
- */
- @Override
- public void validateExecute(IStepContext context, IPropertiesContainer data, IFullQualifiedId fullQualifiedId, IProgressMonitor monitor) throws CoreException {
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.stepper.interfaces.IStep#execute(org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext, org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer, org.eclipse.tcf.te.runtime.stepper.interfaces.IFullQualifiedId, org.eclipse.core.runtime.IProgressMonitor, org.eclipse.tcf.te.runtime.interfaces.callback.ICallback)
- */
- @Override
- public void execute(final IStepContext context, final IPropertiesContainer data, final IFullQualifiedId fullQualifiedId, final IProgressMonitor monitor, final ICallback callback) {
- Protocol.invokeAndWait(new Runnable() {
- @Override
- public void run() {
- int state = getActivePeerModelContext(context, data, fullQualifiedId).getIntProperty(IPeerNodeProperties.PROP_STATE);
- if (state == IPeerNodeProperties.STATE_UNKNOWN || state == IPeerNodeProperties.STATE_NOT_REACHABLE || state == IPeerNodeProperties.STATE_ERROR) {
- getActivePeerModelContext(context, data, fullQualifiedId).setProperty(IPeerNodeProperties.PROP_STATE, IPeerNodeProperties.STATE_WAITING_FOR_READY);
- }
- }
- });
- callback.done(this, Status.OK_STATUS);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.stepper.steps.AbstractStep#getTotalWork(org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext, org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer)
- */
- @Override
- public int getTotalWork(IStepContext context, IPropertiesContainer data) {
- return 100;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.runtime.stepper.steps.AbstractStep#rollback(org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext, org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer, org.eclipse.core.runtime.IStatus, org.eclipse.tcf.te.runtime.stepper.interfaces.IFullQualifiedId, org.eclipse.core.runtime.IProgressMonitor, org.eclipse.tcf.te.runtime.interfaces.callback.ICallback)
- */
- @Override
- public void rollback(final IStepContext context, final IPropertiesContainer data, IStatus status, final IFullQualifiedId fullQualifiedId, IProgressMonitor monitor, ICallback callback) {
- Protocol.invokeAndWait(new Runnable() {
- @Override
- public void run() {
- getActivePeerModelContext(context, data, fullQualifiedId).setProperty(IPeerNodeProperties.PROP_STATE, IPeerNodeProperties.STATE_NOT_REACHABLE);
- }
- });
- super.rollback(context, data, status, fullQualifiedId, monitor, callback);
- }
-}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui.views/META-INF/MANIFEST.MF b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui.views/META-INF/MANIFEST.MF
index 76964c178..9014443ac 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui.views/META-INF/MANIFEST.MF
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui.views/META-INF/MANIFEST.MF
@@ -19,7 +19,8 @@ Require-Bundle: org.eclipse.core.runtime;bundle-version="3.8.0",
org.eclipse.tcf.te.tcf.ui.console;bundle-version="1.2.0",
org.eclipse.tcf.te.ui;bundle-version="1.2.0",
org.eclipse.tcf.te.ui.swt;bundle-version="1.2.0",
- org.eclipse.tcf.te.ui.views;bundle-version="1.2.0"
+ org.eclipse.tcf.te.ui.views;bundle-version="1.2.0",
+ org.eclipse.tcf.te.core;bundle-version="1.2.0"
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-ActivationPolicy: lazy
Bundle-Localization: plugin
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui.views/src/org/eclipse/tcf/te/tcf/ui/views/scriptpad/actions/PeersSubMenuAction.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui.views/src/org/eclipse/tcf/te/tcf/ui/views/scriptpad/actions/PeersSubMenuAction.java
index 436c22425..63fcb819f 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui.views/src/org/eclipse/tcf/te/tcf/ui/views/scriptpad/actions/PeersSubMenuAction.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui.views/src/org/eclipse/tcf/te/tcf/ui/views/scriptpad/actions/PeersSubMenuAction.java
@@ -63,7 +63,7 @@ public class PeersSubMenuAction extends Action implements IMenuCreator, IViewAct
public void locatorModelChanged(IPeerModel model, IPeerNode peer, boolean added) {
// Re-evaluate the enablement
if (actionProxy != null) {
- final IPeerNode[] peers = Model.getModel().getPeers();
+ final IPeerNode[] peers = Model.getModel().getPeerNodes();
actionProxy.setEnabled(peers != null && peers.length > 0);
// If the peer is not set to the view yet, but the action get's
@@ -119,7 +119,7 @@ public class PeersSubMenuAction extends Action implements IMenuCreator, IViewAct
// Determine the enablement. The action is disabled
// if no peers are available.
- IPeerNode[] peers = Model.getModel().getPeers();
+ IPeerNode[] peers = Model.getModel().getPeerNodes();
if (peers != null && peers.length > 0) {
action.setEnabled(true);
if (view instanceof ScriptPad) ((ScriptPad)view).setPeerModel(peers[0]);
@@ -209,18 +209,18 @@ public class PeersSubMenuAction extends Action implements IMenuCreator, IViewAct
boolean selectFirst = selected == null;
- IPeerNode[] peers = Model.getModel().getPeers();
- if (peers != null && peers.length > 0) {
- for (IPeerNode peer : peers) {
- if (isValueAdd(peer)) continue;
- Action action = new PeerAction(view, peer);
+ IPeerNode[] peerNodes = Model.getModel().getPeerNodes();
+ if (peerNodes != null && peerNodes.length > 0) {
+ for (IPeerNode peerNode : peerNodes) {
+ if (isValueAdd(peerNode)) continue;
+ Action action = new PeerAction(view, peerNode);
if (selectFirst) {
action.setChecked(true);
selectFirst = false;
- if (view instanceof ScriptPad) ((ScriptPad)view).setPeerModel(peer);
- } else if (selected != null && selected.equals(peer)) {
+ if (view instanceof ScriptPad) ((ScriptPad)view).setPeerModel(peerNode);
+ } else if (selected != null && selected.equals(peerNode)) {
action.setChecked(true);
- if (view instanceof ScriptPad) ((ScriptPad)view).setPeerModel(peer);
+ if (view instanceof ScriptPad) ((ScriptPad)view).setPeerModel(peerNode);
}
item = new ActionContributionItem(action);
item.fill(m, -1);
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/plugin.properties b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/plugin.properties
index 3d4aad89d..fdf232507 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/plugin.properties
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/plugin.properties
@@ -17,7 +17,6 @@ navigatorContent.name = Dynamic Target Discovery
# ***** Filter *****
-UnreachablePeersFilter.name=Unreachable targets
RedirectPeersFilter.name=Redirected Targets (Root Level)
PeersByCurrentUserFilter.name=Only show targets started by me
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/plugin.xml b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/plugin.xml
index 242b3669d..9fd60e0a4 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/plugin.xml
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/plugin.xml
@@ -147,13 +147,6 @@
-
-
user = new AtomicReference();
Runnable runnable = new Runnable() {
@Override
public void run() {
- IPeerNode peerNode = (IPeerNode)element;
- user.set(peerNode.getPeer().getUserName());
+ user.set(((IPeer)element).getUserName());
}
};
Assert.isTrue(!Protocol.isDispatchThread());
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/filter/UnreachablePeersFilter.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/filter/UnreachablePeersFilter.java
deleted file mode 100644
index d1f122400..000000000
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/filter/UnreachablePeersFilter.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * 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.tcf.ui.filter;
-
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerFilter;
-import org.eclipse.tcf.protocol.Protocol;
-import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode;
-import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNodeProperties;
-
-/**
- * Filter implementation filtering unreachable peers.
- */
-public class UnreachablePeersFilter extends ViewerFilter {
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ViewerFilter#select(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
- */
- @Override
- public boolean select(Viewer viewer, Object parentElement, Object element) {
-
- // Filter only elements of simulator IPeerNode
- if (element instanceof IPeerNode) {
- final IPeerNode peerNode = (IPeerNode)element;
-
- // Determine the current action of the peer model
- final int[] state = new int[1];
- if (Protocol.isDispatchThread()) {
- state[0] = peerNode.getIntProperty(IPeerNodeProperties.PROP_STATE);
- } else {
- Protocol.invokeAndWait(new Runnable() {
- @Override
- public void run() {
- state[0] = peerNode.getIntProperty(IPeerNodeProperties.PROP_STATE);
- }
- });
- }
-
- return state[0] != IPeerNodeProperties.STATE_NOT_REACHABLE && state[0] != IPeerNodeProperties.STATE_ERROR;
- }
-
- return true;
- }
-
-}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/handler/RenameHandler.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/handler/RenameHandler.java
index 3a7be0ccf..af5804276 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/handler/RenameHandler.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/handler/RenameHandler.java
@@ -217,7 +217,7 @@ public class RenameHandler extends AbstractHandler {
IPeerModel model = Model.getModel();
Assert.isNotNull(model);
- IPeerNode[] peers = model.getPeers();
+ IPeerNode[] peers = model.getPeerNodes();
for (IPeerNode peer : peers) {
String name = peer.getPeer().getName();
Assert.isNotNull(name);
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/internal/adapters/EditorSaveAsAdapter.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/internal/adapters/EditorSaveAsAdapter.java
index 849638109..385b24a0a 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/internal/adapters/EditorSaveAsAdapter.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/internal/adapters/EditorSaveAsAdapter.java
@@ -150,7 +150,7 @@ public class EditorSaveAsAdapter implements IEditorSaveAsAdapter {
@Override
public void run() {
// Get all peer model objects
- IPeerNode[] peers = Model.getModel().getPeers();
+ IPeerNode[] peers = Model.getModel().getPeerNodes();
// Loop them and find the ones which are of our handled types
for (IPeerNode peerNode : peers) {
String name = peerNode.getPeer().getName();
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/navigator/ContentProvider.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/navigator/ContentProvider.java
index 4690431d8..ac6414ab4 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/navigator/ContentProvider.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/navigator/ContentProvider.java
@@ -105,10 +105,10 @@ public class ContentProvider implements ICommonContentProvider, ITreePathContent
* @param peerNode The peer model node. Must not be null
.
* @return True
if the peer model node is a value-add, false
otherwise.
*/
- /* default */ final boolean isValueAdd(IPeerNode peerNode) {
- Assert.isNotNull(peerNode);
+ /* default */ final boolean isValueAdd(IPeer peer) {
+ Assert.isNotNull(peer);
- String value = peerNode.getPeer().getAttributes().get("ValueAdd"); //$NON-NLS-1$
+ String value = peer.getAttributes().get("ValueAdd"); //$NON-NLS-1$
boolean isValueAdd = value != null && ("1".equals(value.trim()) || Boolean.parseBoolean(value.trim())); //$NON-NLS-1$
return isValueAdd;
@@ -123,16 +123,31 @@ public class ContentProvider implements ICommonContentProvider, ITreePathContent
/* default */ final boolean isFiltered(IPeerNode peerNode) {
Assert.isNotNull(peerNode);
- boolean filtered = false;
- boolean hideValueAdds = CoreBundleActivator.getScopedPreferences().getBoolean(org.eclipse.tcf.te.tcf.locator.interfaces.preferences.IPreferenceKeys.PREF_HIDE_VALUEADDS);
+ boolean filtered = isFiltered(peerNode.getPeer());
- filtered |= isValueAdd(peerNode) && hideValueAdds;
- if (!showInvisible) {
+ if (!filtered && !showInvisible) {
filtered |= !peerNode.isVisible();
}
- filtered |= peerNode.getPeer().getName() != null
- && peerNode.getPeer().getName().endsWith("Command Server"); //$NON-NLS-1$
+ return filtered;
+ }
+
+ /**
+ * Determines if the given peer node is filtered from the view completely.
+ *
+ * @param peerNode The peer node. Must not be null
.
+ * @return True
if filtered, false
otherwise.
+ */
+ /* default */ final boolean isFiltered(IPeer peer) {
+ Assert.isNotNull(peer);
+
+ boolean filtered = false;
+ boolean hideValueAdds = CoreBundleActivator.getScopedPreferences().getBoolean(org.eclipse.tcf.te.tcf.locator.interfaces.preferences.IPreferenceKeys.PREF_HIDE_VALUEADDS);
+
+ filtered |= isValueAdd(peer) && hideValueAdds;
+
+ filtered |= peer.getName() != null
+ && peer.getName().endsWith("Command Server"); //$NON-NLS-1$
return filtered;
}
@@ -171,11 +186,11 @@ public class ContentProvider implements ICommonContentProvider, ITreePathContent
// If it is the locator model, get the peers
if (parentElement instanceof IPeerModel) {
final IPeerModel model = (IPeerModel)parentElement;
- final IPeerNode[] peers = model.getPeers();
- final List candidates = new ArrayList();
+ final IPeerNode[] peerNodes = model.getPeerNodes();
+ final List