public void partActivated(IWorkbenchPart part) {
   if (part instanceof MapEditor) {
     activeEditor = (MapEditor) part;
     undoAction.setEnabled(activeEditor.canUndo());
     redoAction.setEnabled(activeEditor.canRedo());
   }
 }
 public void propertyChanged(Object source, int propId) {
   if (source == activeEditor) {
     if (propId == MapEditor.PROPERTY_CANUNDO) {
       undoAction.setEnabled(activeEditor.canUndo());
     } else if (propId == MapEditor.PROPERTY_CANREDO) {
       redoAction.setEnabled(activeEditor.canRedo());
     }
   }
 }