@Override public void actionPerformed(ActionEvent e) { if (isEditing()) { SheetCellEditor cellEditor = getEditor(); InplaceEditor inplaceEditor = cellEditor.getInplaceEditor(); if (inplaceEditor instanceof IncrementPropertyValueSupport) { IncrementPropertyValueSupport incrementSupport = ( IncrementPropertyValueSupport ) inplaceEditor; boolean consume = isIncrement ? incrementSupport.incrementValue() : incrementSupport.decrementValue(); if( consume ) return; } } changeRowAction.actionPerformed(e); } }
@Override public void run() { SheetCellEditor cellEditor = getEditor(); if( null != cellEditor ) { InplaceEditor inplace = cellEditor.getInplaceEditor(); if( null != inplace && null != inplace.getComponent() ) { inplace.getComponent().requestFocus(); } } } });
/** Temporarily store the currently edited feature descriptor and partial * value from the editor. This info is used to restore the editing state * after temporary losses of focus and recoverable changes like reordering * the model, or changes that derive from the underlying node */ void saveEditingState() { storedFd = _getSelection(); if (isEditing()) { InplaceEditor ine = getEditor().getInplaceEditor(); if (ine != null) { partialValue = ine.getValue(); } } }
/** Temporarily store the currently edited feature descriptor and partial * value from the editor. This info is used to restore the editing state * after temporary losses of focus and recoverable changes like reordering * the model, or changes that derive from the underlying node */ void saveEditingState() { storedFd = _getSelection(); if (isEditing()) { InplaceEditor ine = getEditor().getInplaceEditor(); if (ine != null) { partialValue = ine.getValue(); } } }
/** Temporarily store the currently edited feature descriptor and partial * value from the editor. This info is used to restore the editing state * after temporary losses of focus and recoverable changes like reordering * the model, or changes that derive from the underlying node */ void saveEditingState() { storedFd = _getSelection(); if (isEditing()) { InplaceEditor ine = getEditor().getInplaceEditor(); if (ine != null) { partialValue = ine.getValue(); } } }
/** Overridden to set the colors apropriately - we always want the editor * to appear selected */ public Component prepareEditor(TableCellEditor editor, int row, int col) { if (editor == null) { return null; } Component result = super.prepareEditor(editor, row, col); if (result == null) { return null; } //Usually result == ine, but custom impls may not be InplaceEditor ine = getEditor().getInplaceEditor(); if (ine.supportsTextEntry()) { result.setBackground(PropUtils.getTextFieldBackground()); result.setForeground(PropUtils.getTextFieldForeground()); } if (result instanceof JComponent) { //unlikely that it won't be ((JComponent)result).setBorder(BorderFactory.createEmptyBorder( 0, PropUtils.getTextMargin(), 0, 0)); } return result; }
/** Overridden to set the colors apropriately - we always want the editor * to appear selected */ public Component prepareEditor(TableCellEditor editor, int row, int col) { if (editor == null) { return null; } Component result = super.prepareEditor(editor, row, col); if (result == null) { return null; } //Usually result == ine, but custom impls may not be InplaceEditor ine = getEditor().getInplaceEditor(); if (ine.supportsTextEntry()) { result.setBackground(PropUtils.getTextFieldBackground()); result.setForeground(PropUtils.getTextFieldForeground()); } if (result instanceof JComponent) { //unlikely that it won't be ((JComponent)result).setBorder(BorderFactory.createEmptyBorder( 0, PropUtils.getTextMargin(), 0, 0)); } return result; }
/** Overridden to set the colors apropriately - we always want the editor * to appear selected */ @Override public Component prepareEditor(TableCellEditor editor, int row, int col) { if (editor == null) { return null; } Component result = super.prepareEditor(editor, row, col); if (result == null) { return null; } if( 1 == col ) { //Usually result == ine, but custom impls may not be InplaceEditor ine = getEditor().getInplaceEditor(); if (ine.supportsTextEntry()) { result.setBackground(PropUtils.getTextFieldBackground()); result.setForeground(PropUtils.getTextFieldForeground()); } } if (result instanceof JComponent) { //unlikely that it won't be ((JComponent) result).setBorder(BorderFactory.createEmptyBorder(0, PropUtils.getTextMargin(), 0, 0)); } return result; }
InplaceEditor ie = getEditor().getInplaceEditor(); if (ie != null) { JComponent comp = ie.getComponent(); if (par != null && par.isAncestorOf(c)) return true; if (c instanceof InplaceEditor) return true; InplaceEditor ine = getEditor().getInplaceEditor(); if (ine != null) { return ine.isKnownComponent(c);
InplaceEditor ie = getEditor().getInplaceEditor(); if (ie != null) { JComponent comp = ie.getComponent(); if (par != null && par.isAncestorOf(c)) return true; if (c instanceof InplaceEditor) return true; InplaceEditor ine = getEditor().getInplaceEditor(); if (ine != null) { return ine.isKnownComponent(c);
protected boolean accept(Component aComponent) { //Do not allow focus to go to a child of the editor we're using if //we are in the process of removing the editor if (isEditing() && inEditorRemoveRequest()) { InplaceEditor ine = getEditor().getInplaceEditor(); if (ine != null) { if (aComponent == ine.getComponent() || ine.isKnownComponent(aComponent)) { return false; } } } return super.accept (aComponent) && aComponent.isShowing(); } }
InplaceEditor ie = getEditor().getInplaceEditor(); InplaceEditor ine = getEditor().getInplaceEditor();
protected boolean accept(Component aComponent) { //Do not allow focus to go to a child of the editor we're using if //we are in the process of removing the editor if (isEditing() && inEditorRemoveRequest()) { InplaceEditor ine = getEditor().getInplaceEditor(); if (ine != null) { if (aComponent == ine.getComponent() || ine.isKnownComponent(aComponent)) { return false; } } } return super.accept (aComponent) && aComponent.isShowing(); } }
@Override protected boolean accept(Component aComponent) { //Do not allow focus to go to a child of the editor we're using if //we are in the process of removing the editor if (isEditing() && inEditorRemoveRequest()) { InplaceEditor ine = getEditor().getInplaceEditor(); if (ine != null) { if ((aComponent == ine.getComponent()) || ine.isKnownComponent(aComponent)) { return false; } } } return super.accept(aComponent) && aComponent.isShowing(); } }
/** 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(); }
/** If we have been editing and the user has typed something, fetch this * value to use in the custom editor */ public Object getPartialValue() { Object partialValue=null; if (isEditing() && (editingRow == getSelectedRow())) { InplaceEditor ine = getEditor().getInplaceEditor(); if (ine != null) { partialValue = ine.getValue(); //reset the inplace editor so the value is not taken when the editor //is closed ine.reset(); getEditor().cancelCellEditing(); } } else { partialValue = null; if (isEditing()) { removeEditor(); } } return partialValue; }
/** If we have been editing and the user has typed something, fetch this * value to use in the custom editor */ public Object getPartialValue() { Object partialValue=null; if (isEditing() && (editingRow == getSelectedRow())) { InplaceEditor ine = getEditor().getInplaceEditor(); if (ine != null) { partialValue = ine.getValue(); //reset the inplace editor so the value is not taken when the editor //is closed ine.reset(); getEditor().cancelCellEditing(); } } else { partialValue = null; if (isEditing()) { removeEditor(); } } return partialValue; }
/** If we have been editing and the user has typed something, fetch this * value to use in the custom editor */ @Override public Object getPartialValue() { Object partialValue = null; if (isEditing() && (editingRow == getSelectedRow())) { InplaceEditor ine = getEditor().getInplaceEditor(); if (ine != null) { partialValue = ine.getValue(); //reset the inplace editor so the value is not taken when the editor //is closed ine.reset(); getEditor().cancelCellEditing(); } } else { partialValue = null; if (isEditing()) { removeEditor(); } } return partialValue; }