org.fest.swing.core.GenericTypeMatcher Java Examples

The following examples show how to use org.fest.swing.core.GenericTypeMatcher. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: SwingElementFinder.java    From ats-framework with Apache License 2.0 6 votes vote down vote up
public static <T extends Component> T find(
                                            Robot robot,
                                            Container root,
                                            GenericTypeMatcher<T> m ) {

    ComponentHierarchy hierarchy = robot.hierarchy();
    List<Component> found = null;
    if (root == null) {
        found = find(hierarchy, m);
    } else {
        found = find(new SingleComponentHierarchy(root, hierarchy), m);
    }
    if (found.isEmpty()) {
        throw componentNotFound(robot, hierarchy, m);
    }
    if (found.size() > 1) {
        throw multipleComponentsFound(found, m);
    }
    Component component = found.iterator().next();
    return m.supportedType().cast(component);
}
 
Example #2
Source File: SwingElementFinder.java    From ats-framework with Apache License 2.0 5 votes vote down vote up
public static List<Component> find(
                                    ComponentHierarchy hierarchy,
                                    Container root,
                                    GenericTypeMatcher<Component> m ) {

    List<Component> found = null;
    if (root == null) {
        found = find(hierarchy, m);
    } else {
        found = find(new SingleComponentHierarchy(root, hierarchy), m);
    }
    return found;
}
 
Example #3
Source File: IdeaFrameFixture.java    From flutter-intellij with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
@NotNull
public IdeSettingsDialogFixture invokeSdkManager() {
  ActionButton sdkButton = waitUntilShowingAndEnabled(robot(), target(), new GenericTypeMatcher<ActionButton>(ActionButton.class) {
    @Override
    protected boolean isMatching(@NotNull ActionButton actionButton) {
      return "SDK Manager".equals(actionButton.getAccessibleContext().getAccessibleName());
    }
  });
  robot().click(sdkButton);
  return IdeSettingsDialogFixture.find(robot());
}
 
Example #4
Source File: IdeaFrameFixture.java    From flutter-intellij with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
public void selectPreviousEditor() {
  robot().pressAndReleaseKey(KeyEvent.VK_E, SystemInfo.isMac ? META_MASK : CTRL_MASK);
  GuiTests.waitUntilShowing(robot(), new GenericTypeMatcher<JLabel>(JLabel.class) {
    @Override
    protected boolean isMatching(@NotNull JLabel header) {
      return Objects.equals(header.getText(), "Recent Files");
    }
  });
  robot().pressAndReleaseKey(KeyEvent.VK_ENTER, 0);
}
 
Example #5
Source File: DataSourceSelectorGuiTest.java    From intellij-xquery with Apache License 2.0 5 votes vote down vote up
@Test
public void shouldDisplayNoSelected() {
    window.label(new GenericTypeMatcher<BasicComboBoxRenderer>(BasicComboBoxRenderer.class) {
        @Override
        protected boolean isMatching(BasicComboBoxRenderer component) {
            return true;
        }
    }).requireText(NO_DATA_SOURCE);
}
 
Example #6
Source File: IdeaFrameFixture.java    From flutter-intellij with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
@NotNull
public ActionButtonFixture findAttachDebuggerToAndroidProcessButton() {
  GenericTypeMatcher<ActionButton> matcher = Matchers.byText(ActionButton.class, "Attach Debugger to Android Process").andIsShowing();
  return ActionButtonFixture.findByMatcher(matcher, robot(), target());
}