Пример #1
0
  /**
   * Sets content widget.
   *
   * @param widget content widget
   */
  public final void setContentWidget(Widget widget) {
    container.add(widget);
    for (FocusWidget focusWidget : UIUtil.getFocusableChildren(widget)) {
      focusWidget.addBlurHandler(blurHandler);
    }

    focusView();
  }
 protected void checkWidgetVisibleAndEnable(FocusWidget widget, String objectLocalization) {
   Assert.assertTrue(
       csvRunner.getAssertionErrorMessagePrefix()
           + "Widget have to be enabled : "
           + objectLocalization,
       widget.isEnabled());
   checkWidgetVisible(widget, objectLocalization);
 }
Пример #3
0
  /**
   * <b>Affected Elements:</b>
   *
   * <ul>
   *   <li>-item# = the option at the specified index.
   * </ul>
   *
   * @see UIObject#onEnsureDebugId(String)
   */
  @Override
  protected void onEnsureDebugId(String baseID) {
    super.onEnsureDebugId(baseID);

    // Set the id of each option
    int numItems = getItemCount();
    for (int i = 0; i < numItems; i++) {
      ensureDebugId(getSelectElement().getOptions().getItem(i), baseID, "item" + i);
    }
  }
Пример #4
0
  protected void close() {
    // if hide is called before the callback the callback can create another
    // Message (without being hidden instantanousely)!
    hide();

    if (requiresReturnValue) {
      if (returnOption == GOptionPane.CANCEL_OPTION) {
        returnValue = initialSelectionValue;
      } else {
        returnValue = inputField.getText();
      }
    }

    if (returnHandler != null) {
      App.debug("option: " + returnOption + "  value: " + returnValue);
      String[] dialogResult = {returnOption + "", returnValue};
      returnHandler.callback(dialogResult);
    }

    // return the focus to the input field calling this dialog
    if (caller != null) caller.setFocus(true);
    caller = null;
  }
Пример #5
0
  private void setCellStyleForMark(FocusWidget widget, Mark mark) {
    widget.removeStyleName(style.cellStateX());
    widget.removeStyleName(style.cellStateO());
    widget.removeStyleName(style.cellStateEmpty());

    switch (mark) {
      case X:
        widget.addStyleName(style.cellStateX());
        break;

      case O:
        widget.addStyleName(style.cellStateO());
        break;

      case EMPTY:
        widget.addStyleName(style.cellStateEmpty());
        break;
    }

    widget.setEnabled(mark == Mark.EMPTY);
  }
Пример #6
0
 public void setTabIndex(int tabIndex) {
   for (Widget anOptionsContainer : getWidget()) {
     FocusWidget widget = (FocusWidget) anOptionsContainer;
     widget.setTabIndex(tabIndex);
   }
 }
 public void isNotEnabled(String objectLocalization) {
   FocusWidget button = getFocusWidget(objectLocalization);
   Assert.assertFalse(
       csvRunner.getAssertionErrorMessagePrefix() + "is Enabled " + objectLocalization,
       button.isEnabled());
 }