Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLucas Bullen2017-12-01 11:05:29 -0500
committerLucas Bullen2017-12-01 11:52:09 -0500
commit45c76cacad2d0e3839304f2a16330b02d965c3b1 (patch)
tree0f3be5461656fe1f9910a2199d002e76d4fa4dd3
parent1ee194e213ba0ebcad498da3abbd8f4677bd8f47 (diff)
downloadeclipse.platform.text-I20171202-0800.tar.gz
eclipse.platform.text-I20171202-0800.tar.xz
eclipse.platform.text-I20171202-0800.zip
Bug 527071 - [generic editor] Hover in .project editor does not workI20171204-0530I20171203-2000I20171203-0800I20171202-1500I20171202-0800I20171201-2000
Nature Label Hover was returning an empty string instead of null Change-Id: Ic64575e8e0230a2b617f1fb8178627251063cd30 Signed-off-by: Lucas Bullen <lbullen@redhat.com>
-rw-r--r--org.eclipse.ui.genericeditor.examples/src/org/eclipse/ui/genericeditor/examples/dotproject/NatureLabelHoverProvider.java5
-rw-r--r--org.eclipse.ui.genericeditor/src/org/eclipse/ui/internal/genericeditor/hover/CompositeInformationControl.java12
2 files changed, 11 insertions, 6 deletions
diff --git a/org.eclipse.ui.genericeditor.examples/src/org/eclipse/ui/genericeditor/examples/dotproject/NatureLabelHoverProvider.java b/org.eclipse.ui.genericeditor.examples/src/org/eclipse/ui/genericeditor/examples/dotproject/NatureLabelHoverProvider.java
index e6fd01b94..f8af6da84 100644
--- a/org.eclipse.ui.genericeditor.examples/src/org/eclipse/ui/genericeditor/examples/dotproject/NatureLabelHoverProvider.java
+++ b/org.eclipse.ui.genericeditor.examples/src/org/eclipse/ui/genericeditor/examples/dotproject/NatureLabelHoverProvider.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2016 Red Hat Inc. and others
+ * Copyright (c) 2016, 2017 Red Hat 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
@@ -7,6 +7,7 @@
*
* Contributors:
* Mickael Istria, Sopot Cela (Red Hat Inc.)
+ * Lucas Bullen (Red Hat Inc.) - [Bug 527071] Hover breaks with missing nature
*******************************************************************************/
package org.eclipse.ui.genericeditor.examples.dotproject;
@@ -39,7 +40,7 @@ public class NatureLabelHoverProvider implements ITextHover {
if (natureDescriptors[i].getNatureId().equals(selection))
return natureDescriptors[i].getLabel();
}
- return "";
+ return null;
}
@Override
diff --git a/org.eclipse.ui.genericeditor/src/org/eclipse/ui/internal/genericeditor/hover/CompositeInformationControl.java b/org.eclipse.ui.genericeditor/src/org/eclipse/ui/internal/genericeditor/hover/CompositeInformationControl.java
index a63088f2f..86d0f62a2 100644
--- a/org.eclipse.ui.genericeditor/src/org/eclipse/ui/internal/genericeditor/hover/CompositeInformationControl.java
+++ b/org.eclipse.ui.genericeditor/src/org/eclipse/ui/internal/genericeditor/hover/CompositeInformationControl.java
@@ -7,6 +7,7 @@
*
* Contributors:
* - Mickael Istria (Red Hat Inc.)
+ * - Lucas Bullen (Red Hat Inc.) - [Bug 527071] Empty string as content breaks hover
*******************************************************************************/
package org.eclipse.ui.internal.genericeditor.hover;
@@ -70,8 +71,11 @@ public class CompositeInformationControl extends AbstractInformationControl impl
if (informationControl != null) {
if (informationControl instanceof IInformationControlExtension2) {
((IInformationControlExtension2)informationControl).setInput(entry.getValue());
- } else {
- informationControl.setInformation(entry.getValue().toString());
+ continue;
+ }
+ String information = entry.getValue().toString();
+ if(!information.isEmpty()){
+ informationControl.setInformation(information);
}
}
}
@@ -107,14 +111,14 @@ public class CompositeInformationControl extends AbstractInformationControl impl
}
}
}
-
+
@Override
public void dispose() {
controls.values().forEach(IInformationControl::dispose);
controls.clear();
super.dispose();
}
-
+
@Override
public IInformationControlCreator getInformationPresenterControlCreator() {
if (controls.isEmpty()) {

Back to the top