!7 set flag DynModule. cmodule InputTokenizer > DynBigInputAndSections { S functions = functions_default; sS functions_default = joinWithComma( f javaTok, f javaTokWithBrackets, f javaTokNPunct, f javaTokWithAngleBrackets); JComponent wrapTextArea(JTextArea textArea) { ret centerAndSouthWithMargins(textArea, centerAndEastWithMargin( withLabel("Tokenization functions:", dm_textField('functions)), jbutton("Restore default", r { setField(functions := functions_default) }))); } void makeSections_impl() { S text = this.text; JTextPane tp = fontSizePlus(5, setFont(typeWriterFont(), jTextPane())); bool first = true; LPair toks = map_pcall(functions(), fn -> pair(fn, (LS) callAndMake(fn, text))); // find out max width int maxWidth = 0; for (LS tok : pairsB(toks)) { ai_tokenizationToTextPane(jTextPane(), tok); maxWidth = max(maxWidth, ai_tokenizationToTextPane_charsWritten!); } for (Pair fAndTok : toks) pcall { if (!first) appendToTextPane(tp, "\n"); else first = false; ai_tokenizationToTextPane(tp, fAndTok.b); appendToTextPane(tp, spaces(maxWidth-ai_tokenizationToTextPane_charsWritten!+1) + "[" + fAndTok.a + "]"); } addSection("Tokenizations", tp); } Collection functions() { ret tok_allIdentifiers(functions); } }