Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.ui.genericeditor/src/org/eclipse/ui/internal/genericeditor/markers/MarkerInformationControl.java')
-rw-r--r--org.eclipse.ui.genericeditor/src/org/eclipse/ui/internal/genericeditor/markers/MarkerInformationControl.java20
1 files changed, 8 insertions, 12 deletions
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 98bf713d93b..db93b4a9669 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
@@ -11,6 +11,7 @@
package org.eclipse.ui.internal.genericeditor.markers;
import java.util.Collection;
+import java.util.LinkedHashMap;
import java.util.List;
import org.eclipse.core.resources.IMarker;
@@ -19,7 +20,6 @@ import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.jface.text.AbstractInformationControl;
-import org.eclipse.jface.text.AbstractReusableInformationControlCreator;
import org.eclipse.jface.text.IInformationControl;
import org.eclipse.jface.text.IInformationControlCreator;
import org.eclipse.jface.text.IInformationControlExtension;
@@ -46,11 +46,10 @@ import org.eclipse.ui.ide.IDE.SharedImages;
public class MarkerInformationControl extends AbstractInformationControl implements IInformationControl, IInformationControlExtension, IInformationControlExtension2 {
- private IInformationControlCreator creator;
+ private final LinkedHashMap<IMarker, Composite> composites = new LinkedHashMap<>();
- public MarkerInformationControl(Shell parentShell, IInformationControlCreator creator) {
- super(parentShell, EditorsUI.getTooltipAffordanceString());
- this.creator = creator;
+ public MarkerInformationControl(Shell parentShell, boolean showAffordanceString) {
+ super(parentShell, showAffordanceString ? EditorsUI.getTooltipAffordanceString() : null);
create();
}
@@ -84,9 +83,11 @@ public class MarkerInformationControl extends AbstractInformationControl impleme
@SuppressWarnings("unchecked")
@Override
public void setInput(Object input) {
+ this.composites.values().forEach(Composite::dispose);
this.markers = (List<IMarker>)input;
for (IMarker marker : this.markers) {
Composite markerComposite = new Composite(parent, SWT.NONE);
+ this.composites.put(marker, markerComposite);
GridLayout gridLayout = new GridLayout(1, false);
gridLayout.verticalSpacing = 0;
markerComposite.setLayout(gridLayout);
@@ -135,17 +136,12 @@ public class MarkerInformationControl extends AbstractInformationControl impleme
});
}
}
- parent.pack(true);
+ parent.layout(true);
}
@Override
public IInformationControlCreator getInformationPresenterControlCreator() {
- return new AbstractReusableInformationControlCreator() {
- @Override
- protected IInformationControl doCreateInformationControl(Shell parent) {
- return creator.createInformationControl(parent);
- }
- };
+ return new MarkerHoverControlCreator(false);
}
@Override

Back to the top