/** Overridden to check the focus event countdown and initiate editing on * the second focus event following a failed edit (dialog was shown) */ public void processFocusEvent(FocusEvent fe) { super.processFocusEvent(fe); if (fe.getID() == fe.FOCUS_GAINED) { countDown--; if (countDown == 0) { autoEdit(); } } if (fe.getID() == fe.FOCUS_GAINED || (fe.getOppositeComponent() != null && fe.getID() == fe.FOCUS_LOST && !isAncestorOf(fe.getOppositeComponent()))) { //Ensure the description goes back to the node description if //we lose focus fireChange(); } }
/** Overridden to check the focus event countdown and initiate editing on * the second focus event following a failed edit (dialog was shown) */ public void processFocusEvent(FocusEvent fe) { super.processFocusEvent(fe); if (fe.getID() == fe.FOCUS_GAINED) { countDown--; if (countDown == 0) { autoEdit(); } } if (fe.getID() == fe.FOCUS_GAINED || (fe.getOppositeComponent() != null && fe.getID() == fe.FOCUS_LOST && !isAncestorOf(fe.getOppositeComponent()))) { //Ensure the description goes back to the node description if //we lose focus fireChange(); } }
/** Overridden to check the focus event countdown and initiate editing on * the second focus event following a failed edit (dialog was shown) */ @Override public void processFocusEvent(FocusEvent fe) { super.processFocusEvent(fe); if (fe.getID() == fe.FOCUS_GAINED) { countDown--; if (countDown == 0) { autoEdit(); } } if ( (fe.getID() == fe.FOCUS_GAINED) || ((fe.getOppositeComponent() != null) && (fe.getID() == fe.FOCUS_LOST) && !isAncestorOf(fe.getOppositeComponent())) ) { //Ensure the description goes back to the node description if //we lose focus fireChange(); } }
/** If the editor loses focus, we're done editing - fire COMMAND_FAILURE */ public void focusLost(FocusEvent e) { Component c = e.getOppositeComponent(); if (!isAncestorOf(c) && c != getEditor().getEditorComponent()) { if (c == this || (c instanceof SheetTable && ((SheetTable)c).isAncestorOf(this))) { //workaround for issue 38029 - editable combo editor can lose focus to ...itself return; } setActionCommand(COMMAND_FAILURE); log (" Combo editor lost focus - setting action command to " + COMMAND_FAILURE); getEditor().getEditorComponent().removeFocusListener(this); if (checker == null) { log ("No active popup checker, firing action event"); fireActionEvent(); } } }
/** If the editor loses focus, we're done editing - fire COMMAND_FAILURE */ public void focusLost(FocusEvent e) { Component c = e.getOppositeComponent(); if (!isAncestorOf(c) && c != getEditor().getEditorComponent()) { if (c == this || (c instanceof SheetTable && ((SheetTable)c).isAncestorOf(this))) { //workaround for issue 38029 - editable combo editor can lose focus to ...itself return; } setActionCommand(COMMAND_FAILURE); log (" Combo editor lost focus - setting action command to " + COMMAND_FAILURE); getEditor().getEditorComponent().removeFocusListener(this); if (checker == null) { log ("No active popup checker, firing action event"); fireActionEvent(); } } }
/** If the editor loses focus, we're done editing - fire COMMAND_FAILURE */ @Override public void focusLost(FocusEvent e) { Component c = e.getOppositeComponent(); if (!isAncestorOf(c) && (c != getEditor().getEditorComponent())) { if ((c == this) || (c instanceof SheetTable && ((SheetTable) c).isAncestorOf(this))) { //workaround for issue 38029 - editable combo editor can lose focus to ...itself return; } setActionCommand(COMMAND_FAILURE); log(" Combo editor lost focus - setting action command to " + COMMAND_FAILURE); getEditor().getEditorComponent().removeFocusListener(this); if (checker == null) { log("No active popup checker, firing action event"); fireActionEvent(); } } }