MCPcopy Create free account
hub / github.com/Card-Forge/forge / buildMenu

Method buildMenu

forge-gui-mobile/src/forge/toolbox/FTextField.java:58–78  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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() {

Callers

nothing calls this directly

Calls 10

getLocalizerMethod · 0.95
getClipboardMethod · 0.95
getSelectedTextMethod · 0.95
insertTextMethod · 0.95
endEditMethod · 0.95
lengthMethod · 0.80
addItemMethod · 0.65
getMessageMethod · 0.45
setContentsMethod · 0.45
getContentsMethod · 0.45

Tested by

no test coverage detected