!7 static L sentences; static SingleComponentPanel scp; static int startIndex; concept Sentence { S text; S action; } p-substance { unswing { db(); new ConceptFieldIndex(mainConcepts, Sentence, "text"); } showFrame(centerAndSouth(scp = new SingleComponentPanel, jcenteredline(jbutton("Prev", r { startIndex = max(startIndex-10, 0); makePanel(); }), jbutton("Next", r { if (startIndex+10 < countConcepts(Sentence)) { startIndex = startIndex+10; makePanel(); } })))); makePanel(); } svoid makePanel { sentences = toLinesFullTrim(loadSnippet(#1008606)); sentences = notStartingWith("\"", sentences); time { makeUniqueConcepts(Sentence, "text", sentences); } JPanel panel = gridLayoutPanel_trackWidth_evenlySpacedCols(2); panel.add(jlabel("Sentence")); panel.add(jlabel("Action")); for (final Sentence s : takeFirst(10, dropFirst(startIndex, list(Sentence)))) { panel.add(jtextfield(s.text)); bool hasAction = nempty(s.action); final JTextField tf = jtextfield(or2(s.action, "screw it")); final new Var reviseBtn; final new Var okBtn; okBtn.set(jbutton("OK", r { cset(s, action := getTextTrim(tf)); disableTextField(tf); replaceComponent(okBtn!, reviseBtn!); })); reviseBtn.set(jbutton("Revise", r { cset(s, action := null); enableTextField(tf); replaceComponent(reviseBtn!, okBtn!); })); if (hasAction) disableTextField(tf); panel.add(centerAndEast(tf, hasAction ? reviseBtn! : okBtn!)); } scp.setComponent(jscroll(panel)); }