Package com.googlecode.mgwt.ui.client.widget.dialog.options

Examples of com.googlecode.mgwt.ui.client.widget.dialog.options.OptionsDialog


   * @param callback - the callback of the button that was selected
   * @param widgetToCover - the widget that should be covered by the dialog
   */
  public static Dialog options(List<OptionsDialogEntry> options, OptionCallback callback, HasWidgets widgetToCover) {

    OptionsDialog optionsDialog = new OptionsDialog();

    int count = 0;
    for (OptionsDialogEntry optionsDialogEntry : options) {
      count++;
      Button button = new Button(optionsDialogEntry.getText());
      switch (optionsDialogEntry.getType()) {
        case NORMAL:
          break;
        case IMPORTANT:
          button.setImportant(true);
          break;
        case CONFIRM:
          button.setConfirm(true);
          break;
        default:
          throw new RuntimeException("how did we get here?");
      }
      button.addTapHandler(new InternalTouchHandler(count, optionsDialog, callback));
      optionsDialog.add(button);
    }
    optionsDialog.setPanelToOverlay(widgetToCover);
    optionsDialog.show();
    return optionsDialog;
  }
View Full Code Here

TOP

Related Classes of com.googlecode.mgwt.ui.client.widget.dialog.options.OptionsDialog

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.