Package java.awt

Examples of java.awt.Window


    Robot robot = null;
    try {
      robot = BasicRobot.robotWithCurrentAwtHierarchy();
      robot.showWindow(frame);
      robot.showPopupMenu(frame.textField);
      Window ancestor = WindowAncestorFinder.windowAncestorOf(frame.popupMenu);
      assertThat(ancestor).isSameAs(frame);
    } finally {
      if (robot != null) {
        robot.cleanUp();
      }
View Full Code Here


    }
  }

  @Test
  public void should_return_parent_as_ancestor_if_Component_is_MenuElement_and_invoker_is_null() {
    Window ancestor = WindowAncestorFinder.windowAncestorOf(frame.popupMenu);
    assertThat(ancestor).isSameAs(parentOf(frame.popupMenu));
  }
View Full Code Here

*/
public class JToolBarDriver_unfloat_Test extends JToolBarDriver_TestCase {
  @Test
  public void should_unfloat_JToolbar() {
    showWindow();
    Window oldAncestor = toolBarAncestor();
    Point where = whereToFloatTo();
    driver.floatTo(toolBar, where.x, where.y);
    driver.unfloat(toolBar);
    assertThat(toolBarAncestor()).isSameAs(oldAncestor);
  }
View Full Code Here

* @author Alex Ruiz
*/
public class AWT_isHeavyWeightPopup_Test extends EDTSafeTestCase {
  @Test
  public void should_return_false_if_Component_is_Window() {
    Window w = singletonWindowMock();
    assertThat(AWT.isHeavyWeightPopup(w)).isFalse();
  }
View Full Code Here

    }
  }

  @RunsInCurrentThread
  private static @Nonnull Pair<Window, Point> ancestorAndLocation(final @Nonnull JToolBar toolBar) {
    Window window = getWindowAncestor(toolBar);
    return Pair.of(window, window.getLocation());
  }
View Full Code Here

   * @throws IllegalStateException if the {@code JToolBar} is disabled.
   * @throws IllegalStateException if the {@code JToolBar} is not showing on the screen.
   */
  @RunsInEDT
  public void unfloat(@Nonnull JToolBar toolBar) {
    Window w = windowAncestorOf(toolBar);
    if (w != null) {
      robot.close(w);
    }
  }
View Full Code Here

    verify(windows).markAsShowing(window);
  }

  @Test
  public void shouldProcessEventWithIdEqualToWindowOpenedAndMarkWindowAsReadyIfWindowIsFileDialog() {
    Window w = new FileDialog(window);
    when(context.storedQueueFor(w)).thenReturn(w.getToolkit().getSystemEventQueue());
    monitor.eventDispatched(new ComponentEvent(w, WINDOW_OPENED));
    verify(context).addContextFor(w);
    verify(windows).attachNewWindowVisibilityMonitor(w);
    verify(windows).markAsShowing(w);
    verify(windows).markAsReady(w);
View Full Code Here

  }

  @Test
  public void should_unfloat_JToolbar() {
    showWindow();
    Window originalAncestor = toolBarAncestor();
    Point where = whereToFloatTo();
    driver.floatTo(toolBar, where.x, where.y);
    driver.unfloat(toolBar, constraint);
    assertThat(toolBarAncestor()).isSameAs(originalAncestor);
    assertThat(window.componentAt(constraint)).isSameAs(toolBar);
View Full Code Here

  }

  @RunsInEDT
  private void activateWindowOfFocusTarget(@Nullable Component target, @Nullable Component currentOwner) {
    Pair<Window, Window> windowAncestors = windowAncestorsOf(currentOwner, target);
    Window currentOwnerAncestor = windowAncestors.first;
    Window targetAncestor = windowAncestors.second;
    if (currentOwnerAncestor == targetAncestor) {
      return;
    }
    activate(checkNotNull(targetAncestor));
    waitForIdle();
View Full Code Here

  @RunsInEDT
  private boolean isWindowAncestorReadyForInput(final JPopupMenu popup) {
    Boolean result = execute(new GuiQuery<Boolean>() {
      @Override
      protected Boolean executeInEDT() {
        Window ancestor = checkNotNull(getWindowAncestor(popup));
        return isReadyForInput(ancestor);
      }
    });
    return checkNotNull(result);
  }
View Full Code Here

TOP

Related Classes of java.awt.Window

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.