| 72 | public static Box padFactory(Box parent, String kind, String name) { |
| 73 | |
| 74 | Box c = parent.first(DefaultMenus.ensureChildOfClass) |
| 75 | .get() |
| 76 | .apply(parent, name, SimpleCanvas.class); |
| 77 | |
| 78 | if (c.properties.isTrue(DefaultMenus.wasNew, false)) { |
| 79 | c.properties.put(Execution.code, code_padFactory); |
| 80 | |
| 81 | parent.find(Boxes.root, parent.upwards()).findFirst().map( r -> r.disconnect(c)); |
| 82 | } |
| 83 | |
| 84 | c.properties.put(DragToCopy._ownedByParent, true); |
| 85 | |
| 86 | return c; |
| 87 | } |
| 88 | |
| 89 | @Override |
| 90 | public Mouse.Dragger onMouseDown(Window.Event<Window.MouseState> e, int button) { |
| 91 | if (button == 0) return button0(e); |
| 92 | return null; |