コード例 #1
0
ファイル: BaseView.java プロジェクト: raphsoft/che
  /**
   * 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();
  }
コード例 #2
0
 protected void checkWidgetVisibleAndEnable(FocusWidget widget, String objectLocalization) {
   Assert.assertTrue(
       csvRunner.getAssertionErrorMessagePrefix()
           + "Widget have to be enabled : "
           + objectLocalization,
       widget.isEnabled());
   checkWidgetVisible(widget, objectLocalization);
 }
コード例 #3
0
ファイル: ListBox.java プロジェクト: smclaughry/Sabot
  /**
   * <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
ファイル: GwtGameView.java プロジェクト: dleblanc/gwt-tac-toe
  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);
   }
 }
コード例 #7
0
 public void isNotEnabled(String objectLocalization) {
   FocusWidget button = getFocusWidget(objectLocalization);
   Assert.assertFalse(
       csvRunner.getAssertionErrorMessagePrefix() + "is Enabled " + objectLocalization,
       button.isEnabled());
 }