Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPablo Torregrosa Paez2015-11-26 10:44:57 -0500
committerPablo Torregrosa Paez2015-11-26 10:46:23 -0500
commit8ace9ffa9b85f3ba871a4f810b720349badd7df1 (patch)
tree0538a1fbd514ec8b1d35afbcd4edf7b4d34e23fe /target_explorer
parent9bcd2716b3097a7e8679f68c38bdb8777418f831 (diff)
downloadorg.eclipse.tcf-8ace9ffa9b85f3ba871a4f810b720349badd7df1.tar.gz
org.eclipse.tcf-8ace9ffa9b85f3ba871a4f810b720349badd7df1.tar.xz
org.eclipse.tcf-8ace9ffa9b85f3ba871a4f810b720349badd7df1.zip
Target Explorer: Avoid duplicated warnings in context selector toolbar
Change-Id: I82d3cecbc09331370166a6f2c8108dbbd187727c Signed-off-by: Pablo Torregrosa Paez <pablo.torregrosa@windriver.com>
Diffstat (limited to 'target_explorer')
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/handler/DefaultContextSelectorToolbarContribution.java14
1 files changed, 13 insertions, 1 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/handler/DefaultContextSelectorToolbarContribution.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/handler/DefaultContextSelectorToolbarContribution.java
index 0fe762e3e..48834bfbd 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/handler/DefaultContextSelectorToolbarContribution.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/handler/DefaultContextSelectorToolbarContribution.java
@@ -741,8 +741,20 @@ implements IWorkbenchContribution, IEventListener, IPeerModelListener, IProperty
Map<String,String> warningsMap = CommonUtils.getPeerWarnings(pNode);
if (warningsMap != null) {
Iterator<Entry<String, String>> warningsMapIterator = warningsMap.entrySet().iterator();
+ List<String> currentModulesDisplayed = new ArrayList<String>(); // To avoid duplicated warnings
while (warningsMapIterator.hasNext()) {
- String warningStr = warningsMapIterator.next().getValue();
+ Entry<String, String> warningsMapEntry = warningsMapIterator.next();
+
+ // Check duplicated warnings
+ String warningOrigin = CommonUtils.getPeerWarningOrigin(pNode, warningsMapEntry.getKey());
+ if (warningOrigin != null) {
+ if (currentModulesDisplayed.contains(warningOrigin)) {
+ continue;
+ }
+ currentModulesDisplayed.add(warningOrigin);
+ }
+
+ String warningStr = warningsMapEntry.getValue();
tooltipStringBuilder.append("<p>"); //$NON-NLS-1$
tooltipStringBuilder.append(warningStr);
tooltipStringBuilder.append("</p>"); //$NON-NLS-1$

Back to the top