Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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