Codota Logo
GuiActionRunner
Code IndexAdd Codota to your IDE (free)

How to use
GuiActionRunner
in
org.assertj.swing.edt

Best Java code snippets using org.assertj.swing.edt.GuiActionRunner (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
DateTime d =
  • Codota Iconnew DateTime()
  • Codota IconDateTimeFormatter formatter;String text;formatter.parseDateTime(text)
  • Codota IconObject instant;new DateTime(instant)
  • Smart code suggestions by Codota
}
origin: dboissier/mongo4idea

@Before
public void setUp() {
  mongoEditionPanel = GuiActionRunner.execute(new GuiQuery<MongoEditionPanel>() {
    protected MongoEditionPanel executeInEDT() {
      return new MongoEditionPanel(mockMongoOperations, mockActionCallback) {
        @Override
        void buildPopupMenu() {
        }
      };
    }
  });
}
origin: joel-costigliola/assertj-swing

/**
 * Executes the given task in the event dispatch thread (EDT). This method waits until the task has finished its
 * execution.
 *
 * @param task the task to execute.
 * @throws org.assertj.swing.exception.UnexpectedException wrapping any <b>checked</b> exception thrown when executing
 *           the given query in the
 *           event dispatch thread (EDT). Unchecked exceptions are re-thrown without any wrapping.
 * @see #executeInEDT()
 * @see #execute(GuiActionRunnable)
 */
public static void execute(@Nonnull GuiTask task) {
 if (!executeInEDT) {
  executeInCurrentThread(task);
  return;
 }
 run(task);
 rethrowCaughtExceptionIn(task);
}
origin: joel-costigliola/assertj-swing

/**
 * Executes the given query in the event dispatch thread (EDT). This method waits until the query has finished its
 * execution.
 *
 * @param query the query to execute.
 * @param <T> the return type of the action to execute.
 * @return the result of the query executed in the main thread.
 * @throws org.assertj.swing.exception.UnexpectedException wrapping any <b>checked</b> exception thrown when executing
 *           the given query in the
 *           event dispatch thread (EDT). Unchecked exceptions are re-thrown without any wrapping.
 * @see #executeInEDT()
 * @see #execute(Callable)
 */
@Nullable public static <T> T execute(@Nonnull GuiQuery<T> query) {
 if (!executeInEDT) {
  return executeInCurrentThread(query);
 }
 run(query);
 return resultOf(query);
}
origin: joel-costigliola/assertj-swing

@Nullable private static <T> T resultOf(@Nonnull GuiQuery<T> query) {
 T result = query.result();
 query.clearResult();
 rethrowCaughtExceptionIn(query);
 return result;
}
origin: dboissier/mongo4idea

@Before
public void setUp() {
  MockitoAnnotations.initMocks(MongoResultPanelTest.class);
  mongoResultPanel = GuiActionRunner.execute(new GuiQuery<MongoResultPanel>() {
    protected MongoResultPanel executeInEDT() {
      return new MongoResultPanel(DummyProject.getInstance(), mongoDocumentOperations, notifierMock);
    }
  });
  frameFixture = Containers.showInFrame(mongoResultPanel);
}
origin: dboissier/mongo4idea

@Before
public void setUp() {
  mongoManager = Mockito.spy(new MongoManager());
  configurationPanel = GuiActionRunner.execute(new GuiQuery<ServerConfigurationPanel>() {
    protected ServerConfigurationPanel executeInEDT() {
      return new ServerConfigurationPanel(DummyProject.getInstance(), mongoManager);
    }
  });
  frameFixture = Containers.showInFrame(configurationPanel);
}
origin: joel-costigliola/assertj-swing

/**
 * Returns the parent of the given AWT or Swing {@code Component}. This query is executed in the event dispatch thread
 * (EDT).
 * 
 * @param component the given {@code Component}.
 * @return the parent of the given {@code Component}.
 * @see Component#getParent()
 */
@RunsInEDT
@Nullable public static Container parentOf(final @Nonnull Component component) {
 return execute(() -> component.getParent());
}
origin: joel-costigliola/assertj-swing

@RunsInEDT
private static Pair<Container, Point> validateAndFindNormalizeLocation(final @Nonnull JInternalFrame internalFrame) {
 return execute(new GuiQuery<Pair<Container, Point>>() {
  @Override
  protected Pair<Container, Point> executeInEDT() {
   checkShowingOrIconified(internalFrame);
   return findMaximizeLocation(internalFrame);
  }
 });
}
origin: joel-costigliola/assertj-swing

@Nonnull private static <T> JList<T> newJList() {
 JList<T> result = execute(new GuiQuery<JList<T>>() {
  @Override
  protected JList<T> executeInEDT() {
   return new JList<T>();
  };
 });
 ;
 return checkNotNull(result);
}
origin: joel-costigliola/assertj-swing

@RunsInEDT
static void checkHasSelection(final @Nonnull JTree tree, final @Nonnull String[] selection,
               final @Nonnull JTreePathFinder pathFinder, final @Nonnull Description errMsg) {
 execute(() -> checkSelection(tree, selection, pathFinder, errMsg));
}
origin: joel-costigliola/assertj-swing

@RunsInEDT
static @Nullable Object singleSelectionValue(final @Nonnull JList<?> list, final @Nonnull JListCellReader cellReader) {
 return execute(() -> {
  int selectedIndex = list.getSelectedIndex();
  return (selectedIndex >= 0) ? cellReader.valueAt(list, selectedIndex) : NO_SELECTION_VALUE;
 });
}
origin: joel-costigliola/assertj-swing

@RunsInEDT
private static void appendComponents(final @Nonnull StringBuilder message, final @Nonnull Collection<Component> found) {
 execute(() -> {
  for (Component c : found) {
   message.append(String.format("%n%s", format(c)));
  }
 });
}
origin: joel-costigliola/assertj-swing

@RunsInEDT
private static void appendComponents(final @Nonnull StringBuilder message, final @Nonnull Collection<Component> found) {
 execute(() -> {
  for (Component c : found) {
   message.append(String.format("%n%s", format(c)));
  }
 });
}
origin: joel-costigliola/assertj-swing

@RunsInEDT
static void setValue(final @Nonnull JSpinner spinner, final @Nonnull Object value) {
 execute(() -> {
  checkEnabledAndShowing(spinner);
  spinner.setValue(value);
 });
}
origin: joel-costigliola/assertj-swing

@RunsInEDT
@Nonnull private static Pair<Point, Integer> findScrollUnitInfo(final @Nonnull JScrollBar scrollBar,
  final @Nonnull JScrollBarLocation location, final int times) {
 Pair<Point, Integer> result = execute(new GuiQuery<Pair<Point, Integer>>() {
  @Override
  protected Pair<Point, Integer> executeInEDT() {
   checkEnabledAndShowing(scrollBar);
   return scrollUnitInfo(scrollBar, location, times);
  }
 });
 return checkNotNull(result);
}
origin: joel-costigliola/assertj-swing

@RunsInEDT
@Nonnull private static int[] selectedRowsOf(final @Nonnull JTable table) {
 int[] result = execute(() -> table.getSelectedRows());
 return checkNotNull(result);
}
origin: joel-costigliola/assertj-swing

/**
 * Scrolls a rectangular region of a {@code JComponent} into view.
 * 
 * @param robot simulates user input.
 * @param c the {@code JComponent}.
 * @param rectangle the rectangular region.
 */
private static void scrollToVisible(@Nonnull Robot robot, final @Nonnull JComponent c,
  final @Nonnull Rectangle rectangle) {
 execute(() -> c.scrollRectToVisible(rectangle));
 robot.waitForIdle();
}
origin: joel-costigliola/assertj-swing

 @RunsInEDT
 @Nonnull private static JScrollBar verticalScrollBar(final @Nonnull JScrollPane scrollPane) {
  JScrollBar result = execute(() -> scrollPane.getVerticalScrollBar());
  return checkNotNull(result);
 }
}
origin: joel-costigliola/assertj-swing

@RunsInEDT
static void checkHasSelection(final @Nonnull JTree tree, final @Nonnull int[] selection,
               final @Nonnull Description errMsg) {
 execute(() -> checkSelection(tree, selection, errMsg));
}
origin: joel-costigliola/assertj-swing

/**
 * Returns the editor for the given {@code JTable} cell. This method is executed in the EDT.
 *
 * @param table the given {@code JTable}.
 * @param row the row index of the cell.
 * @param column the column index of the cell.
 * @return the editor for the given {@code JTable} cell.
 */
@RunsInEDT
@Nullable protected static TableCellEditor cellEditor(final @Nonnull JTable table, final int row, final int column) {
 return execute(() -> table.getCellEditor(row, column));
}
org.assertj.swing.edtGuiActionRunner

Javadoc

Executes instances of GuiQuery and GuiTask.

Most used methods

  • execute
    Executes the given task in the event dispatch thread (EDT). This method waits until the task has fin
  • executeInCurrentThread
  • resultOf
  • rethrowCaughtExceptionIn
    Wraps, with a org.assertj.swing.exception.UnexpectedException, and re-throws any caught exception in
  • run

Popular in Java

  • Finding current android device location
  • getContentResolver (Context)
  • getExternalFilesDir (Context)
  • setContentView (Activity)
  • String (java.lang)
  • LinkedHashMap (java.util)
    Hash table and linked list implementation of the Map interface, with predictable iteration order. Th
  • StringTokenizer (java.util)
    The string tokenizer class allows an application to break a string into tokens. The tokenization met
  • Notification (javax.management)
  • IOUtils (org.apache.commons.io)
    General IO stream manipulation utilities. This class provides static utility methods for input/outpu
  • LoggerFactory (org.slf4j)
    The LoggerFactory is a utility class producing Loggers for various logging APIs, most notably for lo
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now