Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUwe Stieber2013-03-30 02:40:12 -0400
committerUwe Stieber2013-03-30 02:40:12 -0400
commitf33e8c2162ce8203eed0a6f4922312d23907e985 (patch)
tree17fc9b8e0b9d32d8f12853ffdeab622d184d645c /target_explorer
parent841c62fa2be7b9745433fbaaf40c4d46040e17f9 (diff)
downloadorg.eclipse.tcf-f33e8c2162ce8203eed0a6f4922312d23907e985.tar.gz
org.eclipse.tcf-f33e8c2162ce8203eed0a6f4922312d23907e985.tar.xz
org.eclipse.tcf-f33e8c2162ce8203eed0a6f4922312d23907e985.zip
Target Explorer: Only filter nodes explicitly marked as "ValueAdd"
Diffstat (limited to 'target_explorer')
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui.views/src/org/eclipse/tcf/te/tcf/ui/views/scriptpad/actions/PeersSubMenuAction.java20
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/navigator/ContentProviderDelegate.java14
2 files changed, 15 insertions, 19 deletions
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 <code>null</code>.
- * @return <code>True</code> if the peer model node is a proxy or value-add, <code>false</code> otherwise.
+ * @return <code>True</code> if the peer model node is value-add, <code>false</code> 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();
}
}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/navigator/ContentProviderDelegate.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/navigator/ContentProviderDelegate.java
index 6263c54b5..f3273f086 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/navigator/ContentProviderDelegate.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/navigator/ContentProviderDelegate.java
@@ -95,20 +95,18 @@ public class ContentProviderDelegate implements ICommonContentProvider, ITreePat
}
/**
- * 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 <code>null</code>.
- * @return <code>True</code> if the peer model node is a proxy or value-add, <code>false</code> otherwise.
+ * @return <code>True</code> if the peer model node is a value-add, <code>false</code> otherwise.
*/
- /* default */ final boolean isProxyOrValueAdd(IPeerModel peerModel) {
+ /* default */ final boolean isValueAdd(IPeerModel peerModel) {
Assert.isNotNull(peerModel);
- 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$
- return isProxy || isValueAdd;
+ return isValueAdd;
}
/**
@@ -122,7 +120,7 @@ public class ContentProviderDelegate implements ICommonContentProvider, ITreePat
boolean filtered = false;
- filtered |= isProxyOrValueAdd(peerModel) && UIPlugin.getDefault().getPreferenceStore().getBoolean(IPreferenceKeys.PREF_HIDE_PROXIES_AND_VALUEADDS);
+ filtered |= isValueAdd(peerModel) && UIPlugin.getDefault().getPreferenceStore().getBoolean(IPreferenceKeys.PREF_HIDE_PROXIES_AND_VALUEADDS);
if (!showInvisible) {
filtered |= !peerModel.isVisible();
}
@@ -208,7 +206,7 @@ public class ContentProviderDelegate implements ICommonContentProvider, ITreePat
boolean isMyTargets = Managers.getCategoryManager().belongsTo(catID, categorizable.getId());
if (!isMyTargets && (isStatic || startedByCurrentUser)) {
// "Value-add's" are not saved to the category persistence automatically
- if (isProxyOrValueAdd(peer)) {
+ if (isValueAdd(peer)) {
Managers.getCategoryManager().addTransient(catID, categorizable.getId());
} else {
Managers.getCategoryManager().add(catID, categorizable.getId());

Back to the top