当前位置: 首页>>代码示例>>Java>>正文


Java DialogBox.show方法代码示例

本文整理汇总了Java中com.google.gwt.user.client.ui.DialogBox.show方法的典型用法代码示例。如果您正苦于以下问题:Java DialogBox.show方法的具体用法?Java DialogBox.show怎么用?Java DialogBox.show使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.google.gwt.user.client.ui.DialogBox的用法示例。


在下文中一共展示了DialogBox.show方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: upgradeWarnDialog

import com.google.gwt.user.client.ui.DialogBox; //导入方法依赖的package包/类
private static void upgradeWarnDialog(String aMessage) {
  final DialogBox dialogBox = new DialogBox(false, true);
  dialogBox.setStylePrimaryName("ode-DialogBox");
  dialogBox.setText(MESSAGES.warningDialogTitle());
  dialogBox.setGlassEnabled(true);
  dialogBox.setAnimationEnabled(true);
  final HTML message = new HTML(aMessage);
  message.setStyleName("DialogBox-message");
  VerticalPanel vPanel = new VerticalPanel();
  Button okButton = new Button("OK");
  okButton.addClickListener(new ClickListener() {
      @Override
      public void onClick(Widget sender) {
        dialogBox.hide();
      }
    });
  vPanel.add(message);
  vPanel.add(okButton);
  dialogBox.setWidget(vPanel);
  dialogBox.center();
  dialogBox.show();
}
 
开发者ID:mit-cml,项目名称:appinventor-extensions,代码行数:23,代码来源:YoungAndroidFormUpgrader.java

示例2: finalDialog

import com.google.gwt.user.client.ui.DialogBox; //导入方法依赖的package包/类
/**
 * The "Final" Dialog box. When a user chooses to end their session
 * due to a conflicting login, we should show this dialog which is modal
 * and has no exit! My preference would have been to close the window
 * altogether, but the browsers won't let javascript code close windows
 * that it didn't open itself (like the main window). I also tried to
 * use document.write() to write replacement HTML but that caused errors
 * in Firefox and strange behavior in Chrome. So we do this...
 *
 * We are called from invalidSessionDialog() (above).
 */
private void finalDialog() {
  // Create the UI elements of the DialogBox
  final DialogBox dialogBox = new DialogBox(false, true); // DialogBox(autohide, modal)
  dialogBox.setStylePrimaryName("ode-DialogBox");
  dialogBox.setText(MESSAGES.finalDialogText());
  dialogBox.setHeight("100px");
  dialogBox.setWidth("400px");
  dialogBox.setGlassEnabled(true);
  dialogBox.setAnimationEnabled(true);
  dialogBox.center();
  VerticalPanel DialogBoxContents = new VerticalPanel();
  HTML message = new HTML(MESSAGES.finalDialogMessage());
  message.setStyleName("DialogBox-message");
  DialogBoxContents.add(message);
  dialogBox.setWidget(DialogBoxContents);
  dialogBox.show();
}
 
开发者ID:mit-cml,项目名称:appinventor-extensions,代码行数:29,代码来源:Ode.java

示例3: corruptionDialog

import com.google.gwt.user.client.ui.DialogBox; //导入方法依赖的package包/类
/**
 * corruptionDialog -- Put up a dialog box explaining that we detected corruption
 * while reading in a project file. There is no continuing once this happens.
 *
 */
void corruptionDialog() {
  // Create the UI elements of the DialogBox
  final DialogBox dialogBox = new DialogBox(false, true); // DialogBox(autohide, modal)
  dialogBox.setStylePrimaryName("ode-DialogBox");
  dialogBox.setText(MESSAGES.corruptionDialogText());
  dialogBox.setHeight("100px");
  dialogBox.setWidth("400px");
  dialogBox.setGlassEnabled(true);
  dialogBox.setAnimationEnabled(true);
  dialogBox.center();
  VerticalPanel DialogBoxContents = new VerticalPanel();
  HTML message = new HTML(MESSAGES.corruptionDialogMessage());
  message.setStyleName("DialogBox-message");
  DialogBoxContents.add(message);
  dialogBox.setWidget(DialogBoxContents);
  dialogBox.show();
}
 
开发者ID:mit-cml,项目名称:appinventor-extensions,代码行数:23,代码来源:Ode.java

示例4: disabledAccountDialog

import com.google.gwt.user.client.ui.DialogBox; //导入方法依赖的package包/类
/**
 * This dialog is showned if an account is disabled. It is
 * completely modal with no escape. The provided URL is displayed in
 * an iframe, so it can be tailored to each person whose account is
 * disabled.
 *
 * @param Url the Url to display in the dialog box.
 */

public void disabledAccountDialog(String Url) {
  // Create the UI elements of the DialogBox
  final DialogBox dialogBox = new DialogBox(false, true); // DialogBox(autohide, modal)
  dialogBox.setStylePrimaryName("ode-DialogBox");
  dialogBox.setText(MESSAGES.accountDisabledMessage());
  dialogBox.setHeight("700px");
  dialogBox.setWidth("700px");
  dialogBox.setGlassEnabled(true);
  dialogBox.setAnimationEnabled(true);
  dialogBox.center();
  VerticalPanel DialogBoxContents = new VerticalPanel();
  HTML message = new HTML("<iframe src=\"" + Url + "\" style=\"border: 0; width: 680px; height: 660px;\"></iframe>");
  message.setStyleName("DialogBox-message");
  DialogBoxContents.add(message);
  dialogBox.setWidget(DialogBoxContents);
  dialogBox.show();
}
 
开发者ID:mit-cml,项目名称:appinventor-extensions,代码行数:27,代码来源:Ode.java

示例5: closeClientSession

import com.google.gwt.user.client.ui.DialogBox; //导入方法依赖的package包/类
private void closeClientSession()
{
	final DialogBox dialog = new DialogBox();
	dialog.add( new Label( "Exiting..." ) );
	dialog.center();
	dialog.show();
	Value v = getLocationValue();
	v.getNewChild( "sid" ).setValue( sid );
	JolieService.Util.getInstance().call(
		"closeClientSession", v, new EchoesCallback() {
		@Override
		public void onSuccess( Value response ) {
			dialog.hide();
		}
	} );
}
 
开发者ID:jolie,项目名称:jolie,代码行数:17,代码来源:Echoes.java

示例6: showEndGame

import com.google.gwt.user.client.ui.DialogBox; //导入方法依赖的package包/类
public void showEndGame(final Runnable runnable) {
  final DialogBox box = new DialogBox();
  box.setAnimationEnabled(true);
  box.setText("Thanks for playing Higher or Lower! *ding*ding*ding*ding*");
  Button b = new Button("Thanks for having me!");
  b.addStyleName("centered");
  b.addClickListener(new ClickListener() {
    public void onClick(Widget sender) {
      runnable.run();
      box.hide();
    }
  });
  box.setWidget(b);
  box.center();
  box.show();
}
 
开发者ID:google-code-export,项目名称:google-gin,代码行数:17,代码来源:DefaultGameDialogs.java

示例7: execute

import com.google.gwt.user.client.ui.DialogBox; //导入方法依赖的package包/类
@Override
public void execute() {
  final DialogBox db = new DialogBox(false, true);
  db.setText("About MIT App Inventor");
  db.setStyleName("ode-DialogBox");
  db.setHeight("200px");
  db.setWidth("400px");
  db.setGlassEnabled(true);
  db.setAnimationEnabled(true);
  db.center();

  VerticalPanel DialogBoxContents = new VerticalPanel();
  String html = MESSAGES.gitBuildId(GitBuildId.getDate(), GitBuildId.getVersion()) +
      "<BR/>Use Companion: " + BlocklyPanel.getCompVersion();
  Config config = Ode.getInstance().getSystemConfig();
  String releaseNotesUrl = config.getReleaseNotesUrl();
  if (!Strings.isNullOrEmpty(releaseNotesUrl)) {
    html += "<BR/><BR/>Please see <a href=\"" + releaseNotesUrl +
        "\" target=\"_blank\">release notes</a>";
  }
  String tosUrl = config.getTosUrl();
  if (!Strings.isNullOrEmpty(tosUrl)) {
    html += "<BR/><BR/><a href=\"" + tosUrl +
        "\" target=\"_blank\">" + MESSAGES.privacyTermsLink() + "</a>";
  }
  HTML message = new HTML(html);

  SimplePanel holder = new SimplePanel();
  Button ok = new Button("Close");
  ok.addClickListener(new ClickListener() {
    public void onClick(Widget sender) {
      db.hide();
    }
  });
  holder.add(ok);
  DialogBoxContents.add(message);
  DialogBoxContents.add(holder);
  db.setWidget(DialogBoxContents);
  db.show();
}
 
开发者ID:mit-cml,项目名称:appinventor-extensions,代码行数:41,代码来源:TopToolbar.java

示例8: createVideoDialog

import com.google.gwt.user.client.ui.DialogBox; //导入方法依赖的package包/类
/**
 * Creates video on page!
 */
private static void createVideoDialog(String tutorialId) {
  // Create the UI elements of the DialogBox
  final DialogBox dialogBox = new DialogBox(true, true); // DialogBox(autohide, modal)
  dialogBox.setStylePrimaryName("ode-DialogBox");
  dialogBox.setText("Tutorial Video");
  dialogBox.setGlassEnabled(true);
  dialogBox.setAnimationEnabled(true);
  VerticalPanel DialogBoxContents = new VerticalPanel();
  // Adds Youtube Video
  HTML message = new HTML("<iframe width=\"560\" height=\"315\" src=\"https://www.youtube.com/embed/" + tutorialId + "?rel=0&autoplay=1\" frameborder=\"0\" allowfullscreen></iframe>");
  message.setStyleName("DialogBox-message");
  FlowPanel holder = new FlowPanel();
  Button ok = new Button("Close");
  ok.addClickListener(new ClickListener() {
      public void onClick(Widget sender) {
        dialogBox.hide();
      }
    });
  ok.setStyleName("DialogBox-button");
  holder.add(ok);
  DialogBoxContents.add(message);
  DialogBoxContents.add(holder);
  dialogBox.setWidget(DialogBoxContents);
  dialogBox.center();
  dialogBox.show();
}
 
开发者ID:mit-cml,项目名称:appinventor-extensions,代码行数:30,代码来源:TutorialPanel.java

示例9: createImageDialog

import com.google.gwt.user.client.ui.DialogBox; //导入方法依赖的package包/类
/**
 * Enlarges image on page
 */
private static void createImageDialog(String img) {
  // Create the UI elements of the DialogBox
  final DialogBox dialogBox = new DialogBox(true, true); // DialogBox(autohide, modal)
  dialogBox.setStylePrimaryName("ode-DialogBox");
  dialogBox.setGlassEnabled(true);
  dialogBox.setAnimationEnabled(true);
  VerticalPanel DialogBoxContents = new VerticalPanel();
  FlowPanel holder = new FlowPanel();
  Button ok = new Button("Close");
  ok.addClickListener(new ClickListener() {
      public void onClick(Widget sender) {
        dialogBox.hide();
      }
    });
  ok.setStyleName("DialogBox-button");

  // Adds Image
  Image image = new Image(img);
  image.addLoadHandler(new LoadHandler() {
      public void onLoad(LoadEvent evt) {
        dialogBox.center();
      }
    });

  image.setStyleName("DialogBox-image");
  holder.add(ok);
  DialogBoxContents.add(image);
  DialogBoxContents.add(holder);
  dialogBox.setWidget(DialogBoxContents);
  dialogBox.center();
  dialogBox.show();
}
 
开发者ID:mit-cml,项目名称:appinventor-extensions,代码行数:36,代码来源:TutorialPanel.java

示例10: createWelcomeDialog

import com.google.gwt.user.client.ui.DialogBox; //导入方法依赖的package包/类
/**
 * Possibly display the MIT App Inventor "Splash Screen"
 *
 * @param force Bypass the check to see if they have dimissed this version
 */
private void createWelcomeDialog(boolean force) {
  if (!shouldShowWelcomeDialog() && !force) {
    maybeShowNoProjectsDialog();
    return;
  }
  // Create the UI elements of the DialogBox
  final DialogBox dialogBox = new DialogBox(false, true); // DialogBox(autohide, modal)
  dialogBox.setStylePrimaryName("ode-DialogBox");
  dialogBox.setText(MESSAGES.createWelcomeDialogText());
  dialogBox.setHeight(splashConfig.height + "px");
  dialogBox.setWidth(splashConfig.width + "px");
  dialogBox.setGlassEnabled(true);
  dialogBox.setAnimationEnabled(true);
  dialogBox.center();
  VerticalPanel DialogBoxContents = new VerticalPanel();
  HTML message = new HTML(splashConfig.content);
  message.setStyleName("DialogBox-message");
  FlowPanel holder = new FlowPanel();
  Button ok = new Button(MESSAGES.createWelcomeDialogButton());
  final CheckBox noshow = new CheckBox(MESSAGES.doNotShow());
  ok.addClickListener(new ClickListener() {
      public void onClick(Widget sender) {
        dialogBox.hide();
        if (noshow.getValue()) { // User checked the box
          userSettings.getSettings(SettingsConstants.SPLASH_SETTINGS).
            changePropertyValue(SettingsConstants.SPLASH_SETTINGS_VERSION,
              "" + splashConfig.version);
          userSettings.saveSettings(null);
        }
        maybeShowNoProjectsDialog();
      }
    });
  holder.add(ok);
  holder.add(noshow);
  DialogBoxContents.add(message);
  DialogBoxContents.add(holder);
  dialogBox.setWidget(DialogBoxContents);
  dialogBox.show();
}
 
开发者ID:mit-cml,项目名称:appinventor-extensions,代码行数:45,代码来源:Ode.java

示例11: sessionDead

import com.google.gwt.user.client.ui.DialogBox; //导入方法依赖的package包/类
/**
 * Show a Dialog Box when we receive an SC_PRECONDITION_FAILED
 * response code to any Async RPC call. This is a signal that
 * either our session has expired, or our login cookie has otherwise
 * become invalid. This is a fatal error and the user should not
 * be permitted to continue (many ignore the red error bar and keep
 * working, in vain). So now when this happens, we put up this
 * modal dialog box which cannot be dismissed. Instead it presents
 * just one option, a "Reload" button which reloads the browser.
 * This should trigger a re-authentication (or in the case of an
 * App Inventor upgrade trigging the problem, the loading of newer
 * code).
 */

public void sessionDead() {
  // Create the UI elements of the DialogBox
  final DialogBox dialogBox = new DialogBox(false, true); // DialogBox(autohide, modal)
  dialogBox.setStylePrimaryName("ode-DialogBox");
  dialogBox.setText(MESSAGES.invalidSessionDialogText());
  dialogBox.setWidth("400px");
  dialogBox.setGlassEnabled(true);
  dialogBox.setAnimationEnabled(true);
  dialogBox.center();
  VerticalPanel DialogBoxContents = new VerticalPanel();
  HTML message = new HTML(MESSAGES.sessionDead());
  message.setStyleName("DialogBox-message");
  FlowPanel holder = new FlowPanel();
  Button reloadSession = new Button(MESSAGES.reloadWindow());
  reloadSession.addClickListener(new ClickListener() {
      public void onClick(Widget sender) {
        dialogBox.hide();
        reloadWindow(true);
      }
    });
  holder.add(reloadSession);
  DialogBoxContents.add(message);
  DialogBoxContents.add(holder);
  dialogBox.setWidget(DialogBoxContents);
  dialogBox.show();
}
 
开发者ID:mit-cml,项目名称:appinventor-extensions,代码行数:41,代码来源:Ode.java

示例12: wontConnectDialog

import com.google.gwt.user.client.ui.DialogBox; //导入方法依赖的package包/类
/**
 * Display a Dialog box that explains that you cannot connect a
 * device or the emulator to App Inventor until you have a project
 * selected.
 */

private void wontConnectDialog() {
  // Create the UI elements of the DialogBox
  final DialogBox dialogBox = new DialogBox(false, true); // DialogBox(autohide, modal)
  dialogBox.setStylePrimaryName("ode-DialogBox");
  dialogBox.setText(MESSAGES.noprojectDialogTitle());
  dialogBox.setHeight("100px");
  dialogBox.setWidth("400px");
  dialogBox.setGlassEnabled(true);
  dialogBox.setAnimationEnabled(true);
  dialogBox.center();
  VerticalPanel DialogBoxContents = new VerticalPanel();
  HTML message = new HTML("<p>" + MESSAGES.noprojectDuringConnect() + "</p>");
  message.setStyleName("DialogBox-message");
  FlowPanel holder = new FlowPanel();
  Button okButton = new Button("OK");
  okButton.addClickListener(new ClickListener() {
      public void onClick(Widget sender) {
        dialogBox.hide();
      }
    });
  holder.add(okButton);
  DialogBoxContents.add(message);
  DialogBoxContents.add(holder);
  dialogBox.setWidget(DialogBoxContents);
  dialogBox.show();
}
 
开发者ID:mit-cml,项目名称:appinventor-extensions,代码行数:33,代码来源:Ode.java

示例13: displayFault

import com.google.gwt.user.client.ui.DialogBox; //导入方法依赖的package包/类
private void displayFault( String faultString )
{
	final DialogBox dialog = new DialogBox();
	dialog.add( new Label( faultString ) );
	Button closeButton = new Button( "Close" );
	closeButton.addClickListener( new ClickListener() {
		public void onClick( Widget arg0 ) {
			dialog.hide();
		}
	} );
	dialog.center();
	dialog.show();
}
 
开发者ID:jolie,项目名称:jolie,代码行数:14,代码来源:EchoesCallback.java

示例14: PopupMessage

import com.google.gwt.user.client.ui.DialogBox; //导入方法依赖的package包/类
static public void PopupMessage(String title, String message) {
    final DialogBox p = new DialogBox(false, false);
    //p.setStyleName(INFO_MSG_STYLE);

    if (title != null) {
        p.setTitle(title);
    }

    VerticalPanel vp = new VerticalPanel();
    vp.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
    vp.setSpacing(10);
    vp.add(new HTML(message));
    vp.add(new HTML(""));

    Button b = new Button("Close");
    vp.add(b);

    p.setWidget(vp);
    p.center();

    b.addClickHandler(new ClickHandler() {
        public void onClick(ClickEvent event) {
            p.hide();
            p.clear();
        }

    });

    p.show();
}
 
开发者ID:lsst,项目名称:firefly,代码行数:31,代码来源:DynUtils.java

示例15: createNoProjectsDialog

import com.google.gwt.user.client.ui.DialogBox; //导入方法依赖的package包/类
/**
 * Creates, visually centers, and optionally displays the dialog box
 * that informs the user how to start learning about using App Inventor
 * or create a new project.
 * @param showDialog Convenience variable to show the created DialogBox.
 * @return The created and optionally displayed Dialog box.
 */
public DialogBox createNoProjectsDialog(boolean showDialog) {
  // Create the UI elements of the DialogBox
  final DialogBox dialogBox = new DialogBox(true, false); //DialogBox(autohide, modal)
  dialogBox.setStylePrimaryName("ode-DialogBox");
  dialogBox.setText(MESSAGES.createNoProjectsDialogText());

  Grid mainGrid = new Grid(2, 2);
  mainGrid.getCellFormatter().setAlignment(0,
      0,
      HasHorizontalAlignment.ALIGN_CENTER,
      HasVerticalAlignment.ALIGN_MIDDLE);
  mainGrid.getCellFormatter().setAlignment(0,
      1,
      HasHorizontalAlignment.ALIGN_CENTER,
      HasVerticalAlignment.ALIGN_MIDDLE);
  mainGrid.getCellFormatter().setAlignment(1,
      1,
      HasHorizontalAlignment.ALIGN_RIGHT,
      HasVerticalAlignment.ALIGN_MIDDLE);

  Image dialogImage = new Image(Ode.getImageBundle().androidGreenSmall());

  Grid messageGrid = new Grid(2, 1);
  messageGrid.getCellFormatter().setAlignment(0,
      0,
      HasHorizontalAlignment.ALIGN_JUSTIFY,
      HasVerticalAlignment.ALIGN_MIDDLE);
  messageGrid.getCellFormatter().setAlignment(1,
      0,
      HasHorizontalAlignment.ALIGN_LEFT,
      HasVerticalAlignment.ALIGN_MIDDLE);

  Label messageChunk1 = new HTML(MESSAGES.createNoProjectsDialogMessage1());

  messageChunk1.setWidth("23em");
  Label messageChunk2 = new Label(MESSAGES.createNoprojectsDialogMessage2());

  // Add the elements to the grids and DialogBox.
  messageGrid.setWidget(0, 0, messageChunk1);
  messageGrid.setWidget(1, 0, messageChunk2);
  mainGrid.setWidget(0, 0, dialogImage);
  mainGrid.setWidget(0, 1, messageGrid);

  dialogBox.setWidget(mainGrid);
  dialogBox.center();

  if (showDialog) {
    dialogBox.show();
  }

  return dialogBox;
}
 
开发者ID:mit-cml,项目名称:appinventor-extensions,代码行数:60,代码来源:Ode.java


注:本文中的com.google.gwt.user.client.ui.DialogBox.show方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。