Moderator: JIDE Support
protected boolean isNavigationKey(KeyStroke ks) {
return ks == null || ks.getKeyCode() == KeyEvent.VK_TAB || ks.getKeyCode() == KeyEvent.VK_ENTER;
}
JIDE Support wrote:By default, the navigable feature only used on TAB and ENTER key. You can override this method below on NavigableTable to apply to arrow keys.protected boolean isNavigationKey(KeyStroke ks) {
return ks == null || ks.getKeyCode() == KeyEvent.VK_TAB || ks.getKeyCode() == KeyEvent.VK_ENTER;
}
JIDE Support wrote:I don't think it looks mouse wheel at all.
JIDE Support wrote:You can just remove the mouse wheel listener after the constructor. There is a way to query the listeners, iterate through all of them and remove the correct one.
public PageNavigationBar(TableScrollPane pane) {
if (pane == null) {
return;
}
_component = pane;
_component.addMouseWheelListener(createMouseWheelListener());
JIDE Support wrote:
- Code: Select all
public PageNavigationBar(TableScrollPane pane) {
if (pane == null) {
return;
}
_component = pane;
_component.addMouseWheelListener(createMouseWheelListener());
It is the TableScrollPane you passed in.
_component.addMouseWheelListener(createMouseWheelListener());
JIDE Support wrote:By default, the navigable feature only used on TAB and ENTER key. You can override this method below on NavigableTable to apply to arrow keys.protected boolean isNavigationKey(KeyStroke ks) {
return ks == null || ks.getKeyCode() == KeyEvent.VK_TAB || ks.getKeyCode() == KeyEvent.VK_ENTER;
}
JIDE Support wrote:I am not sure if you use it in the right way. isNavigationKey alone doesn't do anything. isCellNavigable method should also be implemented to determine which cell can be navigated to.
public class FmsTable extends HierarchicalTable {
@Override
protected boolean isNavigationKey(KeyStroke ks) {
return false;
}
@Override
public boolean isCellNavigable(int i, int i1) {
return false;
}
JIDE Support wrote:You can't return false isCellNavigable for all cells. If so, it will have no effect. The trigger for the cell navigable is the cell that is currently focused has to return true in isCellNavigable. Then it will find the next navigable cell based on the key you pressed.
Users browsing this forum: No registered users and 14 guests