コード例 #1
0
 @RunsInEDT
 static void close(final @Nonnull JInternalFrame internalFrame) {
   execute(
       new GuiTask() {
         @Override
         protected void executeInEDT() {
           internalFrame.doDefaultCloseAction();
         }
       });
 }
コード例 #2
0
 /**
  * Validates that the given table cell is non {@code null} and its indices are not out of bounds.
  *
  * @param table the target {@code JTable}.
  * @param cell to validate.
  * @throws NullPointerException if the cell is {@code null}.
  * @throws IndexOutOfBoundsException if any of the indices (row and column) is out of bounds.
  */
 @RunsInEDT
 public void checkCellIndicesInBounds(final @Nonnull JTable table, final @Nonnull TableCell cell) {
   execute(
       new GuiTask() {
         @Override
         protected void executeInEDT() {
           JTableCellPreconditions.checkCellIndicesInBounds(table, cell);
         }
       });
 }
コード例 #3
0
 @RunsInEDT
 public static void selectRow(final @Nonnull JTree tree, final int row) {
   execute(
       new GuiTask() {
         @Override
         protected void executeInEDT() {
           tree.setSelectionRow(row);
         }
       });
 }
コード例 #4
0
 @Override
 protected void onSetUp() {
   JFrame frame =
       GuiActionRunner.execute(
           new GuiQuery<JFrame>() {
             @Override
             protected JFrame executeInEDT() {
               return new TableFrame();
             }
           });
   window = new FrameFixture(robot(), frame);
   window.show();
 }
 @RunsInEDT
 private static void selectRows(final JTable table, final int from, final int to) {
   execute(
       new GuiTask() {
         @Override
         protected void executeInEDT() {
           if (from != to) {
             table.setSelectionMode(MULTIPLE_INTERVAL_SELECTION);
           }
           table.setRowSelectionInterval(from, to);
         }
       });
 }
コード例 #6
0
 @RunsInEDT
 private static void assertNoSelection(final @Nonnull JTable table) {
   execute(
       new GuiTask() {
         @Override
         protected void executeInEDT() {
           if (!hasSelection(table)) {
             return;
           }
           String format = "[%s] expected no selection but was:<rows=%s, columns=%s>";
           String msg =
               String.format(
                   format,
                   propertyName(table, SELECTION_PROPERTY).value(),
                   format(selectedRowsOf(table)),
                   format(table.getSelectedColumns()));
           fail(msg);
         }
       });
 }
コード例 #7
0
 @RunsInEDT
 static void setRootVisible(final @Nonnull JTree tree, final boolean visible) {
   execute(() -> tree.setRootVisible(visible));
 }
コード例 #8
0
 @RunsInEDT
 private static void ignore(final WindowFilter filter, final Component c) {
   execute(() -> filter.ignore(c));
 }
コード例 #9
0
 @RunsInEDT
 private static void setClosable(final JInternalFrame internalFrame, final boolean closeable) {
   execute(() -> internalFrame.setClosable(closeable));
 }
 @Override
 protected void onSetUp() {
   SampleFrame frame = GuiActionRunner.execute(() -> new SimpleFrame());
   window = new FrameFixture(robot(), frame);
   window.show();
 }