Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
*******************************************************************************/
package org.eclipse.wb.internal.draw2d;

import org.eclipse.wb.draw2d.Figure;
import org.eclipse.wb.draw2d.PaletteFigure;
import org.eclipse.wb.internal.core.EnvironmentUtils;
import org.eclipse.wb.internal.core.utils.ui.GridLayoutFactory;

import org.eclipse.draw2d.IFigure;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.DisposeEvent;
import org.eclipse.swt.events.DisposeListener;
Expand All @@ -41,7 +41,7 @@ public final class CustomTooltipManager implements ICustomTooltipSite {
private final FigureCanvas m_canvas;
private final EventManager m_eventManager;
private Shell m_tooltipShell;
private Figure m_tooltipFigure;
private PaletteFigure m_tooltipFigure;

////////////////////////////////////////////////////////////////////////////
//
Expand Down Expand Up @@ -142,11 +142,11 @@ public void handleEvent(Event event) {
////////////////////////////////////////////////////////////////////////////
protected final void handleShowCustomTooltip(int mouseX, int mouseY) {
hideTooltip();
Figure cursorFigure = m_eventManager.getCursorFigure();
IFigure cursorFigure = m_eventManager.getCursorFigure();
if (cursorFigure instanceof PaletteFigure paletteFigure) {
ICustomTooltipProvider tooltipProvider = paletteFigure.getCustomTooltipProvider();
if (tooltipProvider != null) {
m_tooltipFigure = cursorFigure;
m_tooltipFigure = paletteFigure;
//
m_tooltipShell =
new Shell(m_canvas.getShell(), SWT.NO_FOCUS | SWT.ON_TOP | SWT.TOOL | SWT.SINGLE);
Expand All @@ -156,7 +156,7 @@ protected final void handleShowCustomTooltip(int mouseX, int mouseY) {
m_tooltipShell.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_INFO_BACKGROUND));
//
Control tooltipControl =
tooltipProvider.createTooltipControl(m_tooltipShell, this, cursorFigure);
tooltipProvider.createTooltipControl(m_tooltipShell, this, paletteFigure);
//
if (tooltipControl == null) {
hideTooltip();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
*******************************************************************************/
package org.eclipse.wb.internal.draw2d;

import org.eclipse.wb.draw2d.Figure;
import org.eclipse.wb.draw2d.FigureUtils;

import org.eclipse.draw2d.EventDispatcher;
Expand Down Expand Up @@ -41,7 +40,7 @@ public class EventManager extends EventDispatcher {
private final FigureCanvas m_canvas;
private final RootFigure m_root;
private MouseEvent m_currentEvent;
private Figure m_cursorFigure;
private IFigure m_cursorFigure;
private IFigure m_captureFigure;
private IFigure m_targetFigure;
private Cursor m_cursor;
Expand Down Expand Up @@ -114,7 +113,7 @@ protected void updateFigureToolTipText() {
}
}

private void setFigureUnderCursor(Figure figure, org.eclipse.swt.events.MouseEvent event) {
private void setFigureUnderCursor(IFigure figure, org.eclipse.swt.events.MouseEvent event) {
if (m_cursorFigure != figure) {
sendEvent(() -> m_targetFigure.handleMouseExited(m_currentEvent), event);
//
Expand All @@ -126,12 +125,12 @@ private void setFigureUnderCursor(Figure figure, org.eclipse.swt.events.MouseEve
}
}

public final Figure getCursorFigure() {
public final IFigure getCursorFigure() {
return m_cursorFigure;
}

/**
* Update the {@link Figure} located at the given location which will accept mouse events.
* Update the {@link IFigure} located at the given location which will accept mouse events.
*/
protected final void updateFigureUnderCursor(org.eclipse.swt.events.MouseEvent event) {
TargetFigureFindVisitor visitor = new TargetFigureFindVisitor(m_canvas, event.x, event.y);
Expand Down
Loading