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

Method loaded

src/main/java/fieldcef/plugins/Taps.java:55–96  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

53
54 }
55
56 public void loaded() {
57 properties.put(tap, (x, name) -> {
58
59 String kind = name.substring(0, name.lastIndexOf(":"));
60
61 Box c;
62
63 if (kind.equalsIgnoreCase("PAD"))
64 c = Pads.padFactory(x, kind, name);
65 else
66 c = x.first(Templates.ensureChildTemplated)
67 .get()
68 .apply(x, "tap-" + kind, name);
69
70 if (c == null) // no template or child found, just make a box
71 {
72 c = x.first(DefaultMenus.newBox).get().apply(x);
73 c.properties.put(Box.name, name);
74 }
75
76 // do something with 'c' -> function
77
78 Binding bindingwWas = c.properties.get(tapBinding);
79 if (bindingwWas == null) {
80 Binding binding = new Binding(c, x, name);
81 Optional<RemoteEditor> first = this.first(RemoteEditor.editor, both());
82 if (first.isPresent()) {
83 binding.server = first.get()
84 .getServer();
85 binding.lastSocket = Server.currentWebSocket.get();
86 }
87 c.properties.put(tapBinding, binding);
88 x.first(Chorder.begin).get().apply(c);
89 }
90
91 return c;
92
93 });
94
95
96 this.properties.putToMap(Boxes.insideRunLoop, "main.__activate/deactivate__", this::update);
97 }
98
99 protected boolean update() {

Callers

nothing calls this directly

Calls 9

padFactoryMethod · 0.95
firstMethod · 0.80
isPresentMethod · 0.80
putToMapMethod · 0.80
applyMethod · 0.65
getMethod · 0.65
putMethod · 0.45
bothMethod · 0.45
getServerMethod · 0.45

Tested by

no test coverage detected