protected Fragment createCopyFragment(String wicketId, String text) {
if (app().settings().getBoolean(Keys.web.allowFlashCopyToClipboard, true)) {
// clippy: flash-based copy & paste
Fragment copyFragment = new Fragment(wicketId, "clippyPanel", this);
String baseUrl = WicketUtils.getGitblitURL(getRequest());
ShockWaveComponent clippy = new ShockWaveComponent("clippy", baseUrl + "/clippy.swf");
clippy.setValue("flashVars", "text=" + StringUtils.encodeURL(text));
copyFragment.add(clippy);
return copyFragment;
} else {
// javascript: manual copy & paste with modal browser prompt dialog
Fragment copyFragment = new Fragment(wicketId, "jsPanel", this);