@Override public void process(final LmlParser parser, final LmlTag tag, final Actor actor, final String rawAttributeData) { final ActorConsumer<?, Params> action = parser.parseAction(rawAttributeData, tmpParams); if (action == null) { parser.throwError("Could not find action for: " + rawAttributeData + " with actor: " + actor); } actor.addListener(new FocusListener() { @Override public void keyboardFocusChanged(FocusEvent event, Actor target, boolean focused) { if (target == actor) { tmpParams.actor = actor; tmpParams.focused = focused; action.consume(tmpParams); tmpParams.reset(); } } }); }
private void addEditLine(CharSequence name, final VisTextField textField, CharSequence unity) { Table line = new VisTable(); line.defaults().pad(CB.scaledSizes.MARGINx2); line.add(name).left(); //disable onScreenKeyboard textField.setOnscreenKeyboard(new TextField.OnscreenKeyboard() { @Override public void show(boolean visible) { // do nothing // we use own NumPad } }); textField.addListener(new FocusListener() { public void keyboardFocusChanged(FocusListener.FocusEvent event, Actor actor, boolean focused) { if (focused == true) { if (actor == textField) { actFocusField = textField; } } } }); line.add(textField).expandX().fillX(); line.add(unity); this.row(); this.add(line).expandX().fillX(); }
public FocusListener getSharedFocusListener () { return sharedFocusListener; }
public NumberInputField (FocusListener sharedFocusListener, ChangeListener sharedChangeListener) { this(sharedFocusListener, sharedChangeListener, true); }