private void updateSheetTableSelection(MouseEvent e) { Component comp = (Component) e.getSource(); if (comp instanceof SheetTable) { SheetTable table = (SheetTable) comp; table.changeSelection(table.rowAtPoint(e.getPoint()), 0, false, false); } }
/** Overridden to catch a mouse pressed event over the custom editor * button and invoke the custom editor even if we do not have focus; * otherwise, for example, in the options dialog, clicking from the * tree to the table over the custom editor button will just set focus * to the table, but will not initiate the custom editor dialog */ public void processMouseEvent(MouseEvent me) { if (me.getID() == me.MOUSE_PRESSED) { if (onCustomEditorButton(me) && !hasFocus()) { if (PropUtils.psCommitOnFocusLoss && isEditing()) { getEditor().stopCellEditing(); } int row = rowAtPoint(me.getPoint()); int col = columnAtPoint(me.getPoint()); if (row != -1 && col != -1) { changeSelection(row, col, false, false); getCustomEditorAction().actionPerformed( new ActionEvent (this, ActionEvent.ACTION_PERFORMED, ACTION_CUSTOM_EDITOR)); me.consume(); return; } } } super.processMouseEvent(me); }
/** Overridden to catch a mouse pressed event over the custom editor * button and invoke the custom editor even if we do not have focus; * otherwise, for example, in the options dialog, clicking from the * tree to the table over the custom editor button will just set focus * to the table, but will not initiate the custom editor dialog */ public void processMouseEvent(MouseEvent me) { if (me.getID() == me.MOUSE_PRESSED) { if (onCustomEditorButton(me) && !hasFocus()) { if (PropUtils.psCommitOnFocusLoss && isEditing()) { getEditor().stopCellEditing(); } int row = rowAtPoint(me.getPoint()); int col = columnAtPoint(me.getPoint()); if (row != -1 && col != -1) { changeSelection(row, col, false, false); getCustomEditorAction().actionPerformed( new ActionEvent (this, ActionEvent.ACTION_PERFORMED, ACTION_CUSTOM_EDITOR)); me.consume(); return; } } } super.processMouseEvent(me); }
changeSelection(row, col, false, false); getCustomEditorAction().actionPerformed( new ActionEvent(this, ActionEvent.ACTION_PERFORMED, ACTION_CUSTOM_EDITOR)
changeSelection(row, 1, false, false);
/** Restore the previous editing state, if the previously edited * FeatureDescriptor is still available for editing */ void restoreEditingState() { int idx = indexOfLastSelected(); boolean canResumeEditing = idx != -1; if (!canResumeEditing) { idx = lastSelectedRow; } if (idx == -1) { clearSavedEditingState(); return; } if (idx < getRowCount()) { changeSelection(idx, 1, false, false); if ((canResumeEditing) && wasEditing) { editCellAt(idx, 1); InplaceEditor ine = getEditor().getInplaceEditor(); if ((ine != null) && (partialValue != null)) { ine.setValue(partialValue); } } } clearSavedEditingState(); }
/** Restore the previous editing state, if the previously edited * FeatureDescriptor is still available for editing */ void restoreEditingState() { int idx = indexOfLastSelected(); boolean canResumeEditing = idx != -1; if (!canResumeEditing) idx = lastSelectedRow; if (idx == -1) { clearSavedEditingState(); return; } if (idx < getRowCount()) { changeSelection(idx, 1, false, false); if ((canResumeEditing) && wasEditing) { editCellAt (idx, 1); InplaceEditor ine = getEditor().getInplaceEditor(); if ((ine != null) && (partialValue != null)) { ine.setValue (partialValue); } } } clearSavedEditingState(); }
/** Restore the previous editing state, if the previously edited * FeatureDescriptor is still available for editing */ void restoreEditingState() { int idx = indexOfLastSelected(); boolean canResumeEditing = idx != -1; if (!canResumeEditing) idx = lastSelectedRow; if (idx == -1) { clearSavedEditingState(); return; } if (idx < getRowCount()) { changeSelection(idx, 1, false, false); if ((canResumeEditing) && wasEditing) { editCellAt (idx, 1); InplaceEditor ine = getEditor().getInplaceEditor(); if ((ine != null) && (partialValue != null)) { ine.setValue (partialValue); } } } clearSavedEditingState(); }
removeEditor(); changeSelection (row, 1, false, false);
removeEditor(); changeSelection (row, 1, false, false);
changeSelection (row, column, false, false); if (prevSel != -1) { paintRow(prevSel); changeSelection(row, column, false, false);
changeSelection(row, column, false, false); changeSelection(row, column, false, false);
changeSelection (row, column, false, false); if (prevSel != -1) { paintRow(prevSel); changeSelection(row, column, false, false);