void (HierarchyEvent e) { if ((e.getChangeFlags() & HierarchyEvent.SHOWING_CHANGED) != 0) { if (myTargetEditor.isShowing()) { UndoUtil.enableUndoFor(myTargetEditor.getDocument()); } else { UndoUtil.disableUndoFor(myTargetEditor.getDocument()); } } }