/** @see junit.framework.TestCase#setUp() */
  protected void setUp() throws Exception {
    // JemmyProperties.setCurrentDispatchingModel(
    //    JemmyProperties.ROBOT_MODEL_MASK);

    JemmyProperties.setCurrentOutput(TestOut.getNullOutput());

    String prefsFile = FileUtil.createTempFilename() + "-toolbox.xml";
    workspace_ = new PluginWorkspace(prefsFile);
    window_ = new JFrameOperator(workspace_);
  }
Example #2
0
 @Override
 public Component actionProduced(Void obj) {
   Window popupWindow = null;
   if (pChooser.checkComponent(getWindow())) {
     popupWindow = getWindow();
   } else {
     popupWindow = WindowWaiter.getWindow(getWindow(), pChooser);
   }
   if (popupWindow != null) {
     ComponentSearcher sc = new ComponentSearcher(popupWindow);
     sc.setOutput(TestOut.getNullOutput());
     return sc.findComponent(cChooser);
   } else {
     return null;
   }
 }
  /** @see junit.framework.TestCase#setUp() */
  protected void setUp() throws Exception {
    super.setUp();

    // JemmyProperties.setCurrentDispatchingModel(
    //    JemmyProperties.ROBOT_MODEL_MASK);

    JemmyProperties.setCurrentOutput(TestOut.getNullOutput());

    final JFontChooserDialog fsd = new JFontChooserDialog(new JFrame(), "Select font", false);

    fsd.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);

    fsd.addFontDialogListener(
        new IFontChooserDialogListener() {
          public void okButtonPressed(JFontChooser fontPanel) {
            logger_.debug("OK button pressed");
            fsd.dispose();
          }

          public void cancelButtonPressed(JFontChooser fontPanel) {
            logger_.debug("Cancel button pressed");
            fsd.dispose();
          }

          public void applyButtonPressed(JFontChooser fontPanel) {
            logger_.debug("Apply button pressed");
          }
        });

    SwingUtil.centerWindow(fsd);
    fsd.setVisible(true);

    dialog_ = new JDialogOperator("Select font");

    applyButton_ = JemmyUtil.findButton(dialog_, JFontChooserDialog.NAME_APPLY_BUTTON);

    cancelButton_ = JemmyUtil.findButton(dialog_, JFontChooserDialog.NAME_CANCEL_BUTTON);

    okButton_ = JemmyUtil.findButton(dialog_, JFontChooserDialog.NAME_OK_BUTTON);

    fontList_ = new JListOperator(dialog_, new NameComponentChooser(JFontChooser.NAME_FONT_LIST));

    styleList_ = new JListOperator(dialog_, new NameComponentChooser(JFontChooser.NAME_STYLE_LIST));

    sizeList_ = new JListOperator(dialog_, new NameComponentChooser(JFontChooser.NAME_SIZE_LIST));
  }
Example #4
0
 @Override
 public boolean checkComponent(Component comp) {
   ComponentSearcher cs = new ComponentSearcher((Container) comp);
   cs.setOutput(TestOut.getNullOutput());
   return cs.findComponent(pChooser) != null;
 }