if (comp instanceof KeyboardFocusable)
((KeyboardFocusable)comp).selectAll(e == null);
else if (comp instanceof ChangeAwareTextField){
ChangeAwareTextField text=((ChangeAwareTextField)comp);
if (e==null){
text.selectAll();
}
else if (e instanceof MouseEvent){
if (nameCell){
MouseEvent me=(MouseEvent)e;
Rectangle bounds=text.getBounds(null);
Rectangle cell=getCellRect(row,column,false);
bounds.setFrame(cell.getX()+bounds.getX(),cell.getY()+bounds.getY(),bounds.getWidth(),bounds.getHeight());
if(bounds.contains(me.getPoint())){
text.selectAllOnNextCaretUpdate(); //to avoid diselection when the cell is clicked
}
else{ //because if it's outside there's no caret update
text.requestFocus();
text.selectAll();
}
}else
text.selectAllOnNextCaretUpdate(); //to avoid diselection when the cell is clicked
}
text.resetChange();
}
}
return b;
}