void passToSearchField(KeyEvent e) { //Don't do anything for normal navigation keys if (e.getKeyCode() == KeyEvent.VK_TAB || e.getKeyCode() == KeyEvent.VK_ENTER || ((e.getKeyCode() == KeyEvent.VK_UP || e.getKeyCode() == KeyEvent.VK_DOWN) && (searchField == null || !searchField.isShowing()))) { return; } if (getRowCount() == 0) { return; } if (searchField == null || !searchField.isShowing()) { showSearchField(); searchField.setText(String.valueOf(e.getKeyChar())); } }
void passToSearchField(KeyEvent e) { //Don't do anything for normal navigation keys if (e.getKeyCode() == KeyEvent.VK_TAB || e.getKeyCode() == KeyEvent.VK_ENTER || ((e.getKeyCode() == KeyEvent.VK_UP || e.getKeyCode() == KeyEvent.VK_DOWN) && (searchField == null || !searchField.isShowing()))) { return; } if (getRowCount() == 0) { return; } if (searchField == null || !searchField.isShowing()) { showSearchField(); searchField.setText(String.valueOf(e.getKeyChar())); } }
void passToSearchField(KeyEvent e) { if (! isQuickSearchAllowed()) { return; } //Don't do anything for normal navigation keys if ( (e.getKeyCode() == KeyEvent.VK_TAB) || (e.getKeyCode() == KeyEvent.VK_ENTER) || (((e.getKeyCode() == KeyEvent.VK_UP) || (e.getKeyCode() == KeyEvent.VK_DOWN)) && ((searchField == null) || !searchField.isShowing())) ) { return; } if (getRowCount() == 0) { return; } if ((searchField == null) || !searchField.isShowing()) { showSearchField(); searchField.setText(String.valueOf(e.getKeyChar())); } }
protected int getVisibleRowCount() { int rowCount = getRowCount(); int rowHeight = getRowHeight(); if (rowCount == 0 || rowHeight == 0) { return 0; } if (getParent() instanceof JViewport) { JViewport jvp = (JViewport) getParent(); int result = Math.min (rowCount, jvp.getExtentSize().height / rowHeight); return result; } else { return Math.min(rowCount, getHeight() / rowHeight); } }
protected int getVisibleRowCount() { int rowCount = getRowCount(); int rowHeight = getRowHeight(); if (rowCount == 0 || rowHeight == 0) { return 0; } if (getParent() instanceof JViewport) { JViewport jvp = (JViewport) getParent(); int result = Math.min (rowCount, jvp.getExtentSize().height / rowHeight); return result; } else { return Math.min(rowCount, getHeight() / rowHeight); } }
protected int getVisibleRowCount() { int rowCount = getRowCount(); int rowHeight = getRowHeight(); if ((rowCount == 0) || (rowHeight == 0)) { return 0; } if (getParent() instanceof JViewport) { JViewport jvp = (JViewport) getParent(); // +1 to return also half-displayed rows (issue 53660) int result = Math.min(rowCount, (jvp.getExtentSize().height / rowHeight) + 1); return result; } else { return Math.min(rowCount, getHeight() / rowHeight); } }
private void reverseSearch(String txt) { if ((txt == null) || (txt.length() == 0)) { return; } int max = getRowCount(); int pos = getSelectedRow(); if (pos < 1) { pos = max - 1; } for (int i = pos - 1; i >= 0; i--) { boolean match = matchText(BaseTable.this.getValueAt(i, 0), txt); if (match) { changeSelection(i, 0, false, false); //Set renderers can overpaint it, so repaint repaint(); break; } } }
private void forwardSearch(String txt) { if (txt == null || txt.length() == 0) { return; } int max = getRowCount(); int pos = getSelectedRow()+1; if (pos == max - 1 || pos < 0) { pos = 0; } for (int i=pos; i < max; i++) { boolean match = matchText(BaseTable.this.getValueAt(i, 0), txt); if (match) { changeSelection(i, 0, false, false); //Set renderers can overpaint it, so repaint repaint(); break; } } }
private void forwardSearch(String txt) { if (txt == null || txt.length() == 0) { return; } int max = getRowCount(); int pos = getSelectedRow()+1; if (pos == max - 1 || pos < 0) { pos = 0; } for (int i=pos; i < max; i++) { boolean match = matchText(BaseTable.this.getValueAt(i, 0), txt); if (match) { changeSelection(i, 0, false, false); //Set renderers can overpaint it, so repaint repaint(); break; } } }
private void forwardSearch(String txt) { if ((txt == null) || (txt.length() == 0)) { return; } int max = getRowCount(); int pos = getSelectedRow() + 1; if ((pos == (max - 1)) || (pos < 0)) { pos = 0; } for (int i = pos; i < max; i++) { boolean match = matchText(BaseTable.this.getValueAt(i, 0), txt); if (match) { changeSelection(i, 0, false, false); //Set renderers can overpaint it, so repaint repaint(); break; } } }
private void reverseSearch(String txt) { if (txt == null || txt.length() == 0) { return; } int max = getRowCount(); int pos = getSelectedRow(); if (pos < 1) { pos = max-1; } for (int i=pos-1; i >=0; i--) { boolean match = matchText(BaseTable.this.getValueAt(i, 0), txt); if (match) { changeSelection(i, 0, false, false); //Set renderers can overpaint it, so repaint repaint(); break; } } }
private void reverseSearch(String txt) { if (txt == null || txt.length() == 0) { return; } int max = getRowCount(); int pos = getSelectedRow(); if (pos < 1) { pos = max-1; } for (int i=pos-1; i >=0; i--) { boolean match = matchText(BaseTable.this.getValueAt(i, 0), txt); if (match) { changeSelection(i, 0, false, false); //Set renderers can overpaint it, so repaint repaint(); break; } } }
private void processSearchText(String txt) { if (txt == null || txt.length() == 0) { return; } int max = getRowCount(); int pos = getSelectedRow(); if (pos == max - 1 || pos < 0) { pos = 0; } for (int i=0; i < max; i++) { boolean match = matchText(BaseTable.this.getValueAt(i, 0), txt); if (match) { changeSelection(i, 0, false, false); //Set renderers can overpaint it, so repaint repaint(); break; } if (pos++ == max -1) { pos = 0; } } }
private void processSearchText(String txt) { if (txt == null || txt.length() == 0) { return; } int max = getRowCount(); int pos = getSelectedRow(); if (pos == max - 1 || pos < 0) { pos = 0; } for (int i=0; i < max; i++) { boolean match = matchText(BaseTable.this.getValueAt(i, 0), txt); if (match) { changeSelection(i, 0, false, false); //Set renderers can overpaint it, so repaint repaint(); break; } if (pos++ == max -1) { pos = 0; } } }
private void processSearchText(String txt) { if ((txt == null) || (txt.length() == 0)) { return; } int max = getRowCount(); int pos = getSelectedRow(); if ((pos == (max - 1)) || (pos < 0)) { pos = 0; } for (int i = 0; i < max; i++) { boolean match = matchText(BaseTable.this.getValueAt(i, 0), txt); if (match) { changeSelection(i, 0, false, false); //Set renderers can overpaint whole field's panel, so repaint getRootPane().getLayeredPane().repaint(); break; } if (pos++ == (max - 1)) { pos = 0; } } }
if (next >= getRowCount() || next < 0) { if (!(BaseTable.this.getTopLevelAncestor() instanceof Dialog)) { next = next >= getRowCount() ? 0 : getRowCount() - 1; } else if (next >= getRowCount() || next < 0) { if (sibling == BaseTable.this) { changeSelection(direction ? 0 : getRowCount()-1, direction ? 0 : getColumnCount()-1,false,false); } else {
if (next >= getRowCount() || next < 0) { if (!(BaseTable.this.getTopLevelAncestor() instanceof Dialog)) { next = next >= getRowCount() ? 0 : getRowCount() - 1; } else if (next >= getRowCount() || next < 0) { if (sibling == BaseTable.this) { changeSelection(direction ? 0 : getRowCount()-1, direction ? 0 : getColumnCount()-1,false,false); } else {
if ((next >= getRowCount()) || (next < 0)) { if (!(BaseTable.this.getTopLevelAncestor() instanceof Dialog)) { next = (next >= getRowCount()) ? 0 : (getRowCount() - 1); } else if ((next >= getRowCount()) || (next < 0)) { direction ? 0 : (getRowCount() - 1), direction ? 0 : (getColumnCount() - 1), false, false );