public void actionPerformed(ActionEvent e) { if (isEditing() || editorComp != null) { removeEditor(); return; } else { Component c = KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner(); InputMap imp = getRootPane().getInputMap(WHEN_ANCESTOR_OF_FOCUSED_COMPONENT); ActionMap am = getRootPane().getActionMap(); KeyStroke escape = KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0, false); Object key = imp.get(escape); if (key == null) { //Default for NbDialog key = "Cancel"; } if (key != null) { Action a = am.get(key); if (a != null) { String commandKey = (String)a.getValue(Action.ACTION_COMMAND_KEY); if (commandKey == null) { commandKey = key.toString(); } a.actionPerformed(new ActionEvent(this, ActionEvent.ACTION_PERFORMED, commandKey)); //NOI18N } } } }
public void actionPerformed(ActionEvent e) { if (isEditing() || (editorComp != null)) { removeEditor(); return; } else { Component c = KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner(); InputMap imp = getRootPane().getInputMap(WHEN_ANCESTOR_OF_FOCUSED_COMPONENT); ActionMap am = getRootPane().getActionMap(); KeyStroke escape = KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0, false); Object key = imp.get(escape); if (key == null) { //Default for NbDialog key = "Cancel"; } if (key != null) { Action a = am.get(key); if (a != null) { String commandKey = (String) a.getValue(Action.ACTION_COMMAND_KEY); if (commandKey == null) { commandKey = key.toString(); } a.actionPerformed(new ActionEvent(this, ActionEvent.ACTION_PERFORMED, commandKey)); //NOI18N } } } }
public void actionPerformed(ActionEvent e) { if (isEditing() || editorComp != null) { removeEditor(); return; } else { Component c = KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner(); InputMap imp = getRootPane().getInputMap(WHEN_ANCESTOR_OF_FOCUSED_COMPONENT); ActionMap am = getRootPane().getActionMap(); KeyStroke escape = KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0, false); Object key = imp.get(escape); if (key == null) { //Default for NbDialog key = "Cancel"; } if (key != null) { Action a = am.get(key); if (a != null) { String commandKey = (String)a.getValue(Action.ACTION_COMMAND_KEY); if (commandKey == null) { commandKey = key.toString(); } a.actionPerformed(new ActionEvent(this, ActionEvent.ACTION_PERFORMED, commandKey)); //NOI18N } } } }
/** Sets x position. */ public void setPositionX(int x) { if ((x == positionX) || !treeHScrollingEnabled) { return; } int old = positionX; positionX = x; firePropertyChange("positionX", old, x); if (isEditing() && (getEditingColumn() == getTreeColumnIndex())) { CellEditor editor = getCellEditor(); if (ignoreScrolling && editor instanceof TreeTableCellEditor) { ((TreeTableCellEditor) editor).revalidateTextField(); } else { removeEditor(); } } repaint(); }
/** Sets x position. */ public void setPositionX(int x) { if (x == positionX || !treeHScrollingEnabled) return; int old = positionX; positionX = x; firePropertyChange("positionX", old, x); if (isEditing() && getEditingColumn() == getTreeColumnIndex()) { CellEditor editor = getCellEditor(); if (ignoreScrolling && editor instanceof TreeTableCellEditor) { ((TreeTableCellEditor)editor).revalidateTextField(); } else { removeEditor(); } } repaint(); }
/** Sets x position. */ public void setPositionX(int x) { if (x == positionX || !treeHScrollingEnabled) return; int old = positionX; positionX = x; firePropertyChange("positionX", old, x); if (isEditing() && getEditingColumn() == getTreeColumnIndex()) { CellEditor editor = getCellEditor(); if (ignoreScrolling && editor instanceof TreeTableCellEditor) { ((TreeTableCellEditor)editor).revalidateTextField(); } else { removeEditor(); } } repaint(); }
protected void processFocusEvent (FocusEvent fe) { super.processFocusEvent(fe); //Remove the editor here if the new focus owner is not //known to the table & the focus event is not temporary if (fe.getID() == fe.FOCUS_LOST && !fe.isTemporary() && !inRemoveRequest && !inEditRequest) { boolean stopEditing = (fe.getOppositeComponent() != getParent() && !isKnownComponent(fe.getOppositeComponent()) && fe.getOppositeComponent() != null); if (stopEditing) { removeEditor(); } } //The UI will only repaint the lead selection, but we need to //paint all selected rows for the color to change when focus //is lost/gained if (!inRemoveRequest && !inEditRequest) { repaintSelection(fe.getID() == fe.FOCUS_GAINED); } }
protected void processFocusEvent (FocusEvent fe) { super.processFocusEvent(fe); //Remove the editor here if the new focus owner is not //known to the table & the focus event is not temporary if (fe.getID() == fe.FOCUS_LOST && !fe.isTemporary() && !inRemoveRequest && !inEditRequest) { boolean stopEditing = (fe.getOppositeComponent() != getParent() && !isKnownComponent(fe.getOppositeComponent()) && fe.getOppositeComponent() != null); if (stopEditing) { removeEditor(); } } //The UI will only repaint the lead selection, but we need to //paint all selected rows for the color to change when focus //is lost/gained if (!inRemoveRequest && !inEditRequest) { repaintSelection(fe.getID() == fe.FOCUS_GAINED); } }
@Override protected void processFocusEvent(FocusEvent fe) { super.processFocusEvent(fe); //Remove the editor here if the new focus owner is not //known to the table & the focus event is not temporary if ((fe.getID() == FocusEvent.FOCUS_LOST) && !fe.isTemporary() && !inRemoveRequest && !inEditRequest) { boolean stopEditing = ((fe.getOppositeComponent() != getParent()) && !isKnownComponent(fe.getOppositeComponent()) && (fe.getOppositeComponent() != null)); if (stopEditing) { removeEditor(); } } //The UI will only repaint the lead selection, but we need to //paint all selected rows for the color to change when focus //is lost/gained if (!inRemoveRequest && !inEditRequest) { repaintSelection(fe.getID() == FocusEvent.FOCUS_GAINED); } }
removeEditor(); changeSelection(row, column, false, false); } finally {
inEditorChangeRequest = true; try { removeEditor(); changeSelection(row, column, false, false); } finally {
inEditorChangeRequest = true; try { removeEditor(); changeSelection(row, column, false, false); } finally {
public void actionPerformed(ActionEvent e) { if (isEditing()) { removeEditor();
public void actionPerformed(ActionEvent e) { if (isEditing()) { removeEditor();
public void actionPerformed(ActionEvent e) { if (isEditing()) { removeEditor();