protected void configurePopupMenu(JPopupMenu popupMenu) {

		boolean canType = isEditable() && isEnabled();

		// Since the user can customize the popup menu, these actions may not
		// have been created.
		if (undoMenuItem!=null) {
			undoMenuItem.setEnabled(undoAction.isEnabled() && canType);
			redoMenuItem.setEnabled(redoAction.isEnabled() && canType);
			cutMenuItem.setEnabled(cutAction.isEnabled() && canType);
			pasteMenuItem.setEnabled(pasteAction.isEnabled() && canType);
			deleteMenuItem.setEnabled(deleteAction.isEnabled() && canType);
		}

	}