@Override
 public void update(AnActionEvent e) {
   Presentation presentation = e.getPresentation();
   presentation.setEnabled(myElements != null && myIndex < myElements.length - 1);
 }
 @Override
 public void update(AnActionEvent e) {
   Presentation presentation = e.getPresentation();
   presentation.setEnabled(myIndex > 0);
 }