Open new UI from ShortcutAction

Hi all,

in Vaadin 6 it was possible to add an ShortcutAction to the main window which open a new Browser Window …

private class OpenDebugWindowAction extends ShortcutAction implements Action.Listener {

final DebugWindow debugWindow = new DebugWindow();

 public OpenDebugWindowAction() {
      super(null, ShortcutAction.KeyCode.D, new int[]{
                 ShortcutAction.ModifierKey.ALT,
                 ShortcutAction.ModifierKey.CTRL,
       });
 }

@Override
public void handleAction(final Object sender, final Object target) {
  if (debugWindow.getParent() != null || debugWindow.getApplication() != null) {
    return;
  }
  addWindow(debugWindow);
  getMainWindow().open(new ExternalResource(debugWindow.getURL()), "__console__", 200, 200, 2);
  LOGGER.debug("Opened Managementconsole in TAB");
}

}

in Vaadin 7 I found (until now) no way to do this :frowning:

Kind Regards
Andreas

http://www.ahoehma.de

You should be able to use Page.open() in a shortcut listener. However, browser popup blockers may block this, but this was the case in Vaadin 6 as well. There’s the BrowserWindowOpener extension in Vaadin 7 for opening popups on client-side, but unfortunately it currenty only works with clicks, not keyboard.