/** * {@link KeyCode#SPACE SPACE} 'presses' the button. */ @Override public boolean keyReleased(Component component, int keyCode, Keyboard.KeyLocation keyLocation) { boolean consumed = false; ListButton listButton = (ListButton)getComponent(); if (keyCode == Keyboard.KeyCode.SPACE) { pressed = false; repaintComponent(); if (listButton.isRepeatable()) { listButton.press(); } } else { consumed = super.keyReleased(component, keyCode, keyLocation); } return consumed; }
@Override public boolean mouseClick(Component component, Mouse.Button button, int x, int y, int count) { ListButton listButton = (ListButton)getComponent(); listViewPopup.close(); int index = listView.getSelectedIndex(); listButton.setSelectedIndex(index); if (listButton.isRepeatable()) { listButton.press(); } return true; } };
@Override public boolean mouseClick(Component component, Mouse.Button button, int x, int y, int count) { boolean consumed = super.mouseClick(component, button, x, y, count); ListButton listButton = (ListButton)getComponent(); if (listButton.isRepeatable() && !getTriggerBounds().contains(x, y)) { listButton.press(); } return consumed; }
@Override public boolean mouseClick(Component component, Mouse.Button button, int x, int y, int count) { ListButton listButton = (ListButton)getComponent(); listViewPopup.close(); int index = listView.getSelectedIndex(); listButton.setSelectedIndex(index); if (listButton.isRepeatable()) { listButton.press(); } return true; } };
@Override public boolean mouseClick(Component component, Mouse.Button button, int x, int y, int count) { boolean consumed = super.mouseClick(component, button, x, y, count); ListButton listButton = (ListButton)getComponent(); if (listButton.isRepeatable() && !getTriggerBounds().contains(x, y)) { listButton.press(); } return consumed; }
/** * {@link KeyCode#SPACE SPACE} 'presses' the button. */ @Override public boolean keyReleased(Component component, int keyCode, Keyboard.KeyLocation keyLocation) { boolean consumed = false; ListButton listButton = (ListButton)getComponent(); if (keyCode == Keyboard.KeyCode.SPACE) { pressed = false; repaintComponent(); if (listButton.isRepeatable()) { listButton.press(); } } else { consumed = super.keyReleased(component, keyCode, keyLocation); } return consumed; }
@Override public boolean mouseDown(Component component, Mouse.Button button, int x, int y) { boolean consumed = super.mouseDown(component, button, x, y); pressed = true; repaintComponent(); ListButton listButton = (ListButton)component; if (listViewPopup.isOpen()) { listViewPopup.close(); } else if (listButton.isRepeatable() && !getTriggerBounds().contains(x, y)) { listButton.requestFocus(); } else { listViewPopup.open(component.getWindow()); } return consumed; }
@Override public boolean mouseDown(Component component, Mouse.Button button, int x, int y) { boolean consumed = super.mouseDown(component, button, x, y); pressed = true; repaintComponent(); ListButton listButton = (ListButton)component; if (listViewPopup.isOpen()) { listViewPopup.close(); } else if (listButton.isRepeatable() && !getTriggerBounds().contains(x, y)) { listButton.requestFocus(); } else { listViewPopup.open(component.getWindow()); } return consumed; }
listButton.setSelectedIndex(index); if (listButton.isRepeatable()) { listButton.press();
listButton.setSelectedIndex(index); if (listButton.isRepeatable()) { listButton.press();
} else if (!listButton.isRepeatable()){ listViewPopup.open(component.getWindow());
} else if (!listButton.isRepeatable()){ listViewPopup.open(component.getWindow());