diff --git a/org.eclipse.draw2d/src/org/eclipse/draw2d/PopUpHelper.java b/org.eclipse.draw2d/src/org/eclipse/draw2d/PopUpHelper.java index 5e357070e..30f2f597f 100644 --- a/org.eclipse.draw2d/src/org/eclipse/draw2d/PopUpHelper.java +++ b/org.eclipse.draw2d/src/org/eclipse/draw2d/PopUpHelper.java @@ -84,14 +84,7 @@ protected LightweightSystem createLightweightSystem() { * @since 2.0 */ protected Shell createShell() { - // Phillipus changed this. - // If a workbench part is detached and a tooltip is initially displayed, when the part is re-attached - // the parent Shell is disposed which in turn disposes of the PopupHelper's Shell. - // This will lead to an SWT Error when the Shell is accessed again. - // To fix this, create the PopupHelper Shell with the Control's Display instead of its Shell. - - //return new Shell(control.getShell(), shellStyle); - return new Shell(control.getDisplay(), shellStyle); + return new Shell(control.getShell(), shellStyle); } /** diff --git a/org.eclipse.draw2d/src/org/eclipse/draw2d/SWTEventDispatcher.java b/org.eclipse.draw2d/src/org/eclipse/draw2d/SWTEventDispatcher.java index 2a35e2e4e..f3098a3f4 100644 --- a/org.eclipse.draw2d/src/org/eclipse/draw2d/SWTEventDispatcher.java +++ b/org.eclipse.draw2d/src/org/eclipse/draw2d/SWTEventDispatcher.java @@ -335,8 +335,18 @@ protected IFigure getCursorTarget() { * @return the ToolTipHelper */ protected ToolTipHelper getToolTipHelper() { - if (toolTipHelper == null) + // Phillipus changed this. + // If a workbench part is detached and a tooltip is initially displayed, when the part is re-attached + // the parent Shell is disposed which in turn disposes of the PopupHelper's Shell. + // This will lead to an SWT Error when the Shell is accessed again. + // To fix this, if the ToolTipHelper's shell is disposed return a new one + + //if (toolTipHelper == null) + // toolTipHelper = new ToolTipHelper(control); + + if(toolTipHelper == null || toolTipHelper.getShell().isDisposed()) { toolTipHelper = new ToolTipHelper(control); + } return toolTipHelper; }