@Override
  public Window getWindow(String name) {
    // See if the window already exists in the application
    Window window = super.getWindow(name);

    // If a dynamically created window is requested, but
    // it does not exist yet, create it.
    if (window == null) {
      // Create the new window object
      window = new Window("Book Examples Window " + ++windowCount);

      // As the window did not exist, the name parameter is
      // an automatically generated name for a new window.
      window.setName(name);

      // Add it to the application as a regular
      // application-level window. This must be done before
      // calling open, which requires that the window
      // is attached to the application.
      addWindow(window);

      // Open it with the proper URL that includes the
      // automatically generated window name
      window.open(new ExternalResource(window.getURL()));

      // Fill the window with stuff
      init(window);
    }

    return window;
  }
Пример #2
0
 @Override
 public Window getWindow(String name) {
   Window window = super.getWindow(name);
   if (window == null) {
     window = new MainDifferWindow();
     window.setSizeUndefined();
     window.setName(name);
     addWindow(window);
     window.open(new ExternalResource(window.getURL()));
   }
   return window;
 }