svoid dm_stefansAssistant_offerSFOnSnippetCreated() { DynModule mod = dm_current_mandatory(); dm_onSnippetCreated(voidfunc(S snippetID) { print("New snippet! " + snippetID); if (!dm_hadUserActivityInLastNMinutes(1)) ret with print("No user activity, skipping popup dialog"); if (getSnippetType(snippetID) == snippetType_JavaXInclude()) { S text = loadSnippet(snippetID); S sfName = first(findFunctionDefsAtCurlyLevel(0, text)); if (sfName != null) // call activateFrame to bring window to foreground reliably on Windows? disposeWindowAfter(30.0, /*activateFrameAndReturnComponent*/(showPackedFrameInBottomRightCorner( centerAndSouthWithMargins(jlabel("Add standard function: " + sfName + "?"), hgridWithSpacing( jThreadedButton("OK", r { temp dm_enter(mod); disposeWindow(heldInstance(JButton)); addStandardFunctionWithAnimation(snippetID); }), jCancelButton("No") ) )))); } }); }