From f33e8c2162ce8203eed0a6f4922312d23907e985 Mon Sep 17 00:00:00 2001
From: Uwe Stieber
Date: Sat, 30 Mar 2013 07:40:12 +0100
Subject: Target Explorer: Only filter nodes explicitly marked as "ValueAdd"
---
.../views/scriptpad/actions/PeersSubMenuAction.java | 20 +++++++++-----------
1 file changed, 9 insertions(+), 11 deletions(-)
(limited to 'target_explorer/plugins/org.eclipse.tcf.te.tcf.ui.views')
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 4fab27c2b..1075fb32b 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011, 2012 Wind River Systems, Inc. and others. All rights reserved.
+ * Copyright (c) 2011, 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
@@ -212,7 +212,7 @@ public class PeersSubMenuAction extends Action implements IMenuCreator, IViewAct
IPeerModel[] peers = Model.getModel().getPeers();
if (peers != null && peers.length > 0) {
for (IPeerModel peer : peers) {
- if (isProxyOrValueAdd(peer)) continue;
+ if (isValueAdd(peer)) continue;
Action action = new PeerAction(view, peer);
if (selectFirst) {
action.setChecked(true);
@@ -233,31 +233,29 @@ public class PeersSubMenuAction extends Action implements IMenuCreator, IViewAct
}
/**
- * Determines if the given peer model node is a proxy or a value-add.
+ * Determines if the given peer model node is a value-add.
*
* @param peerModel The peer model node. Must not be null
.
- * @return True
if the peer model node is a proxy or value-add, false
otherwise.
+ * @return True
if the peer model node is value-add, false
otherwise.
*/
- /* default */ final boolean isProxyOrValueAdd(final IPeerModel peerModel) {
+ /* default */ final boolean isValueAdd(final IPeerModel peerModel) {
Assert.isNotNull(peerModel);
- final AtomicBoolean isProxyOrValueAdd = new AtomicBoolean();
+ final AtomicBoolean isValueAdd = new AtomicBoolean();
Runnable runnable = new Runnable() {
@Override
public void run() {
- boolean isProxy = peerModel.getPeer().getAttributes().containsKey("Proxy"); //$NON-NLS-1$
-
String value = peerModel.getPeer().getAttributes().get("ValueAdd"); //$NON-NLS-1$
- boolean isValueAdd = value != null && ("1".equals(value.trim()) || Boolean.parseBoolean(value.trim())); //$NON-NLS-1$
+ boolean isValueAddValue = value != null && ("1".equals(value.trim()) || Boolean.parseBoolean(value.trim())); //$NON-NLS-1$
- isProxyOrValueAdd.set(isProxy || isValueAdd);
+ isValueAdd.set(isValueAddValue);
}
};
if (Protocol.isDispatchThread()) runnable.run();
else Protocol.invokeAndWait(runnable);
- return isProxyOrValueAdd.get();
+ return isValueAdd.get();
}
}
--
cgit v1.2.3