MCPcopy Create free account
hub / github.com/OpenEndedGroup/Field2 / run

Method run

src/main/java/fieldbox/boxes/plugins/Rename.java:38–65  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

36 }
37
38 @Override
39 public void run() {
40
41 Map<Pair<String, String>, Runnable> m = new LinkedHashMap<>();
42
43 p.prompt("rename box to...", m, new RemoteEditor.ExtendedCommand() {
44 String altWas = null;
45 Consumer<String> feedback;
46
47 @Override
48 public void begin(RemoteEditor.SupportsPrompt prompt, String alternativeChosen/*, Consumer<String> feedback*/) {
49 altWas = alternativeChosen;
50 this.feedback = feedback;
51 }
52
53 @Override
54 public void run() {
55 Log.log("run", ()->" ALT WAS :" + altWas);
56
57 if (altWas != null) selection().forEach(x -> {
58// UndoStack.u.change(x, Box.name, altWas);
59 x.properties.put(Box.name, altWas);
60 Drawing.dirty(x);
61 if (feedback != null) feedback.accept("Renamed to \"" + altWas + "\"");
62 });
63 }
64 });
65 }
66 });
67
68 if (selection().filter(x -> x.properties.getMap()

Callers

nothing calls this directly

Calls 7

logMethod · 0.95
selectionMethod · 0.95
dirtyMethod · 0.95
promptMethod · 0.80
acceptMethod · 0.65
forEachMethod · 0.45
putMethod · 0.45

Tested by

no test coverage detected