Submit handler to duplicate a display for a view.
public function submitDisplayDuplicate($form, &$form_state) {
$view = $this
->getEntity($form_state);
$display_id = $view->displayID;
// Create the new display.
$displays = $view
->get('display');
$new_display_id = $view
->addDisplay($displays[$display_id]['display_plugin']);
$displays[$new_display_id] = $displays[$display_id];
$displays[$new_display_id]['id'] = $new_display_id;
$view
->set('display', $displays);
// By setting the current display the changed marker will appear on the new
// display.
$view
->get('executable')->current_display = $new_display_id;
views_ui_cache_set($view);
// Redirect to the new display's edit page.
$form_state['redirect'] = 'admin/structure/views/view/' . $view
->get('name') . '/edit/' . $new_display_id;
}