private void updateActions(){
  String selectedText=getSelectedText();
  if (selectedText == null)   selectedText="";
  boolean stuffSelected=!selectedText.equals("");
  boolean allSelected=selectedText.equals(getText());
  UNDO_ACTION.setEnabled(isEnabled() && isEditable() && isUndoAvailable());
  CUT_ACTION.setEnabled(isEnabled() && isEditable() && stuffSelected);
  COPY_ACTION.setEnabled(isEnabled() && stuffSelected);
  PASTE_ACTION.setEnabled(isEnabled() && isEditable() && isPasteAvailable());
  DELETE_ACTION.setEnabled(isEnabled() && stuffSelected);
  SELECT_ALL_ACTION.setEnabled(isEnabled() && !allSelected);
}

private void updateActions ( ) { String selectedText = getSelectedText ( ) ; if ( selectedText == null ) selectedText = "" ; boolean stuffSelected = ! selectedText . equals ( "" ) ; boolean allSelected = selectedText . equals ( getText ( ) ) ; UNDO_ACTION . setEnabled ( isEnabled ( ) && isEditable ( ) && isUndoAvailable ( ) ) ; CUT_ACTION . setEnabled ( isEnabled ( ) && isEditable ( ) && stuffSelected ) ; COPY_ACTION . setEnabled ( isEnabled ( ) && stuffSelected ) ; PASTE_ACTION . setEnabled ( isEnabled ( ) && isEditable ( ) && isPasteAvailable ( ) ) ; DELETE_ACTION . setEnabled ( isEnabled ( ) && stuffSelected ) ; SELECT_ALL_ACTION . setEnabled ( isEnabled ( ) && ! allSelected ) ; }
updates the actions in each text just before showing the popup menu .
