IWorkbenchPart part = getTargetPart();
if (part instanceof ITextEditor) {
fTextEditor = (ITextEditor) part;
fSelectionBeforeEvaluation = getTargetSelection();
}
DebugPopup displayPopup = new InspectPopupDialog(getShell(),
getPopupAnchor(textWidget), ACTION_DEFININITION_ID, expression) {
IContextActivation contextActivation;
@Override
protected Control createDialogArea(Composite parent) {
Control result = super.createDialogArea(parent);
if (fTextEditor != null) {
IContextService contextService = (IContextService) fTextEditor
.getSite().getService(IContextService.class);
contextActivation = contextService
.activateContext("org.eclipse.php.debug.ui.xdebug"); //$NON-NLS-1$
}
return result;
}
public boolean close() {
boolean returnValue = super.close();
if (fTextEditor != null && fSelectionBeforeEvaluation != null) {
fTextEditor.getSelectionProvider().setSelection(
fSelectionBeforeEvaluation);
fTextEditor = null;
fSelectionBeforeEvaluation = null;
}
// if (fTextEditor != null) {
// IContextService contextService = (IContextService)
// fTextEditor
// .getSite().getService(IContextService.class);
// contextService.deactivateContext(contextActivation);
// }
return returnValue;
}
};
displayPopup.open();
}