Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Obuchowicz2019-08-21 15:58:35 -0400
committerAndrew Obuchowicz2019-08-23 10:31:12 -0400
commit39f26b3d27c090b7ce152a1851c3484cb7c8b358 (patch)
tree54689b225abbfcdba7a050d5a386589d159cb44a
parent13712284cc6f426dd64c84c27589755a96979663 (diff)
downloadeclipse.platform.text-39f26b3d27c090b7ce152a1851c3484cb7c8b358.tar.gz
eclipse.platform.text-39f26b3d27c090b7ce152a1851c3484cb7c8b358.tar.xz
eclipse.platform.text-39f26b3d27c090b7ce152a1851c3484cb7c8b358.zip
Bug 547733 - Hover layout issues with composite hover (eg LSP4E)
Fix bug where the resolution link was behind hidden in the generic editor. Change-Id: If791b036a26e887c37c5268ec9895c8afbaf21f3 Signed-off-by: Andrew Obuchowicz <aobuchow@redhat.com>
-rw-r--r--org.eclipse.ui.genericeditor/src/org/eclipse/ui/internal/genericeditor/hover/CompositeInformationControl.java7
-rw-r--r--org.eclipse.ui.genericeditor/src/org/eclipse/ui/internal/genericeditor/markers/MarkerInformationControl.java8
2 files changed, 3 insertions, 12 deletions
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 3a7ae7227..785d7018f 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
@@ -32,7 +32,6 @@ import org.eclipse.jface.text.IInformationControlExtension5;
import org.eclipse.jface.text.ITextHover;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
@@ -89,7 +88,6 @@ public class CompositeInformationControl extends AbstractInformationControl impl
this.controls = new LinkedHashMap<>(); // TODO maybe use canReuse or canReplace
GridLayout layout = new GridLayout(1, false);
parent.setLayout(layout);
- boolean firstControl = true;
for (Entry<ITextHover, IInformationControlCreator> hoverControlCreator : this.creators.entrySet()) {
IInformationControl informationControl = hoverControlCreator.getValue().createInformationControl(parent.getShell());
if (informationControl instanceof AbstractInformationControl) {
@@ -100,13 +98,8 @@ public class CompositeInformationControl extends AbstractInformationControl impl
}
for (Control control : children) {
control.setParent(parent);
- control.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
- }
- if (!firstControl) {
- ((GridData)children.get(0).getLayoutData()).verticalIndent = 15;
}
controls.put(hoverControlCreator.getKey(), informationControl);
- firstControl = false;
} else {
GenericEditorPlugin.getDefault().getLog().log(new Status(IStatus.WARNING, GenericEditorPlugin.BUNDLE_ID,
"Only text hovers producing an AbstractInformationControl can be aggregated; got a " + informationControl.getClass().getSimpleName())); //$NON-NLS-1$
diff --git a/org.eclipse.ui.genericeditor/src/org/eclipse/ui/internal/genericeditor/markers/MarkerInformationControl.java b/org.eclipse.ui.genericeditor/src/org/eclipse/ui/internal/genericeditor/markers/MarkerInformationControl.java
index 908fe42f2..f2f8f084c 100644
--- a/org.eclipse.ui.genericeditor/src/org/eclipse/ui/internal/genericeditor/markers/MarkerInformationControl.java
+++ b/org.eclipse.ui.genericeditor/src/org/eclipse/ui/internal/genericeditor/markers/MarkerInformationControl.java
@@ -110,17 +110,15 @@ public class MarkerInformationControl extends AbstractInformationControl impleme
markerImage.setImage(getImage(marker));
}
Label markerLabel = new Label(markerLine, SWT.NONE);
- String markerText = marker.getAttribute(IMarker.MESSAGE, "missing message"); //$NON-NLS-1$
- markerText = markerText.replace("&", "&&"); // Disable mnemonics //$NON-NLS-1$ //$NON-NLS-2$
+ String markerText = marker.getAttribute(IMarker.MESSAGE, "missing message"); //$NON-NLS-1$
+ markerText = markerText.replace("&", "&&"); // Disable mnemonics //$NON-NLS-1$ //$NON-NLS-2$
markerLabel.setText(markerText);
for (IMarkerResolution resolution : resolutions) {
Composite resolutionComposite = new Composite(markerComposite, SWT.NONE);
GridData layoutData = new GridData();
layoutData.horizontalIndent = 10;
resolutionComposite.setLayoutData(layoutData);
- RowLayout resolutionRowLayout = new RowLayout();
- resolutionRowLayout.marginBottom = 0;
- resolutionComposite.setLayout(resolutionRowLayout);
+ resolutionComposite.setLayout(new RowLayout());
Label resolutionImage = new Label(resolutionComposite, SWT.NONE);
// TODO: try to retrieve icon from QuickFix command
Image resolutionPic = null;

Back to the top