table.addMouseListener( new MouseAdapter() { public void mouseReleased(MouseEvent e) { if (e.isPopupTrigger()) { JTable source = (JTable)e.getSource(); int row = source.rowAtPoint( e.getPoint() ); int column = source.columnAtPoint( e.getPoint() ); if (! source.isRowSelected(row)) source.changeSelection(row, column, false, false); popup.show(e.getComponent(), e.getX(), e.getY()); } } });
table.addMouseListener( new MouseAdapter() { public void mouseReleased(MouseEvent e) { if (e.isPopupTrigger()) { JTable source = (JTable)e.getSource(); int row = source.rowAtPoint( e.getPoint() ); int column = source.columnAtPoint( e.getPoint() ); if (! source.isRowSelected(row)) source.changeSelection(row, column, false, false); popup.show(e.getComponent(), e.getX(), e.getY()); } } });
int column = source.columnAtPoint( e.getPoint() ); if (! source.isRowSelected(row)) source.changeSelection(row, column, false, false);
Component comp = super.prepareRenderer(renderer, row, column); if (!isRowSelected(row)) { int modelRow = convertRowIndexToModel(row); boolean type = (Boolean) getModel().getValueAt(modelRow, 2);
@Override public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int rowIndex, int column) { radio.setSelected(table.isRowSelected(rowIndex)); return super.getTableCellEditorComponent(table, value, isSelected, rowIndex, column); }
@Override public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int rowIndex, int column) { check.setSelected(table.isRowSelected(rowIndex)); return super.getTableCellEditorComponent(table, value, isSelected, rowIndex, column); }
/** * Select the row the mouse cursor is over, except if it is already over an * selected row, in which case it just keeps the current selection. * * @param e The MouseEvent */ private void selectClicked(MouseEvent e) { int row = table.rowAtPoint(e.getPoint()); if (row != -1 && !table.isRowSelected(row)) { table.getSelectionModel().setSelectionInterval(row, row); } }
@Override public boolean isCellEditable(EventObject e) { if (e instanceof MouseEvent) { MouseEvent me = (MouseEvent) e; int index = detailsTable.rowAtPoint(me.getPoint()); return ((me.getClickCount() == 1) && detailsTable.isRowSelected(index)); } return super.isCellEditable(e); }
/** * @see javax.swing.JComponent#isOpaque() */ @SuppressWarnings("unused") public boolean isOpaque(int x, int y) { int rowAtPoint = table.rowAtPoint(new Point(x, y)); return table.isRowSelected(rowAtPoint) ? true : super.isOpaque(); } };
private void selectClicked(MouseEvent e) { int clickedRow = entrantsTable.rowAtPoint(e.getPoint()); if (clickedRow != -1 && !entrantsTable.isRowSelected(clickedRow)) { entrantsTable.setRowSelectionInterval(clickedRow, clickedRow); } }
public boolean volumeRechoiceNow() { JTable targetTable = getSelectedTable(); for (int i = targetTable.getRowCount() - 1; i >= 0; i--) { if (targetTable.isRowSelected(i)) { //rechoiceVolume( i ); addMission(i); return true; } } return false; }
public boolean viewMission() { JTable targetTable = getSelectedTable(); for (int i = targetTable.getRowCount() - 1; i >= 0; i--) { if (targetTable.isRowSelected(i)) { //rechoiceVolume( i ); openDownloadFile(i); return true; } } return false; }
@Override public void mousePressed(MouseEvent me) { JTable table = (JTable) me.getSource(); int row = table.rowAtPoint(me.getPoint()); if(me.isPopupTrigger() && !table.isRowSelected(row)) { // if right click outside the selection then reset selection table.getSelectionModel().setSelectionInterval(row, row); } processMouseEvent(me); } protected void processMouseEvent(MouseEvent me) {
@Override public void mousePressed(MouseEvent me) { JTable table = (JTable) me.getSource(); int row = table.rowAtPoint(me.getPoint()); if(me.isPopupTrigger() && !table.isRowSelected(row)) { // if right click outside the selection then reset selection table.getSelectionModel().setSelectionInterval(row, row); } processMouseEvent(me); } protected void processMouseEvent(MouseEvent me) {
table.addMouseListener( new MouseAdapter() { public void mousePressed(MouseEvent e) { JTable source = (JTable)e.getSource(); int row = source.rowAtPoint( e.getPoint() ); int column = source.columnAtPoint( e.getPoint() ); if (! source.isRowSelected(row)) source.changeSelection(row, column, false, false); } });
/** * Invert the current table selection */ public void onMenuReverseSelection() { IntegerUnion invertedSelection = new IntegerUnion(); for(int viewId = 0; viewId<table.getRowCount();viewId++) { if(!table.isRowSelected(viewId)) { invertedSelection.add(viewId); } } setViewRowSelection(invertedSelection); }
@Override public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int rowIndex, int column) { radio.setSelected(table.isRowSelected(rowIndex)); setBackground(isSelected ? table.getSelectionBackground() : table.getBackground()); if (hasFocus) { setBorder(UIManager.getBorder("Table.focusCellHighlightBorder")); } else { setBorder(null); } return this; }
@Override public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int rowIndex, int column) { check.setSelected(table.isRowSelected(rowIndex)); setBackground(isSelected ? table.getSelectionBackground() : table.getBackground()); if (hasFocus) { setBorder(UIManager.getBorder("Table.focusCellHighlightBorder")); } else { setBorder(null); } return this; } }
if (e.isPopupTrigger()) { JTable source = (JTable)e.getSource(); int row = source.rowAtPoint( e.getPoint() ); int column = source.columnAtPoint( e.getPoint() ); if (! source.isRowSelected(row)) source.changeSelection(row, column, false, false); popup.show(e.getComponent(), e.getX(), e.getY()); }
private void apply(boolean selectedOnly, ReminderAction action) { final ReminderHook reminderController = Controller.getCurrentModeController().getExtension(ReminderHook.class); for (int row = 0; row < tableView.getRowCount(); row++) { if(! selectedOnly || tableView.isRowSelected(row)) { final NodeModel node = getMindMapNode(row); final ReminderExtension reminder = node.getExtension(ReminderExtension.class); if(reminder != null) { action.apply(reminderController, node, reminder, row); } } } }