()
| 56 | |
| 57 | private final FPopupMenu contextMenu = new FPopupMenu() { |
| 58 | @Override |
| 59 | protected void buildMenu() { |
| 60 | if (text.length() > 0) { |
| 61 | if (!readOnly) { |
| 62 | addItem(new FMenuItem(Forge.getLocalizer().getMessage("lblCut"), e -> { |
| 63 | Forge.getClipboard().setContents(getSelectedText()); |
| 64 | textBeforeKeyInput = text; |
| 65 | insertText(""); |
| 66 | endEdit(); |
| 67 | })); |
| 68 | } |
| 69 | addItem(new FMenuItem(Forge.getLocalizer().getMessage("lblCopy"), e -> Forge.getClipboard().setContents(getSelectedText()))); |
| 70 | } |
| 71 | if (!readOnly) { |
| 72 | addItem(new FMenuItem(Forge.getLocalizer().getMessage("lblPaste"), e -> { |
| 73 | textBeforeKeyInput = text; |
| 74 | insertText(Forge.getClipboard().getContents()); |
| 75 | endEdit(); |
| 76 | })); |
| 77 | } |
| 78 | } |
| 79 | }; |
| 80 | |
| 81 | public FTextField() { |
nothing calls this directly
no test coverage detected