Java Code Examples for com.google.gwt.user.client.ui.DialogBox#hide()

The following examples show how to use com.google.gwt.user.client.ui.DialogBox#hide() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AppUtils.java    From swcv with MIT License 6 votes vote down vote up
public static DialogBox createLoadingBox()
{
    final DialogBox box = new DialogBox();
    VerticalPanel rows = new VerticalPanel();
    rows.setSpacing(1);

    HTML html = new HTML("<img src=\"" + GWT.getHostPageBaseURL() + "static/imgs/loader.gif\" alt=\"loading\" />");
    rows.add(html);
    rows.addStyleName("whiteWithBorder");
    rows.setCellHeight(html, "100");
    rows.setCellWidth(html, "300");

    rows.setCellHorizontalAlignment(html, HasHorizontalAlignment.ALIGN_CENTER);
    rows.setCellVerticalAlignment(html, HasVerticalAlignment.ALIGN_MIDDLE);

    HorizontalPanel hp = new HorizontalPanel();
    hp.add(rows);
    box.setWidget(hp);
    box.hide();
    return box;
}
 
Example 2
Source File: ClientUtils.java    From sc2gears with Apache License 2.0 5 votes vote down vote up
/**
 * Creates and returns a {@link Button} which when activated closes the specified dialog box.
 * @param dialogBox  dialog box to close when the close button is activated
 * @param buttonText text of the close button
 * @return a button which when activated closes the specified dialog box
 */
public static Button createDialogCloseButton( final DialogBox dialogBox, final String buttonText ) {
	return new Button( buttonText, new ClickHandler() {
		@Override
		public void onClick( final ClickEvent event ) {
			dialogBox.hide();
		}
	} );
}
 
Example 3
Source File: AppUtils.java    From swcv with MIT License 5 votes vote down vote up
public static DialogBox createMessageBox(String message, final DialogBox shadow)
{
    // Create a dialog box and set the caption text
    final DialogBox dialogBox = new DialogBox();

    // Create a table to layout the content
    VerticalPanel dialogContents = new VerticalPanel();
    dialogContents.setSpacing(4);
    dialogBox.setWidget(dialogContents);

    // Add an image to the dialog
    HTML html = new HTML(message);
    dialogContents.add(html);
    dialogContents.setCellHorizontalAlignment(html, HasHorizontalAlignment.ALIGN_CENTER);

    // Add a close button at the bottom of the dialog
    Button closeButton = new Button("Close", new ClickHandler()
    {
        public void onClick(ClickEvent event)
        {
            if (shadow != null)
                shadow.hide();
            dialogBox.hide();
        }
    });

    dialogContents.add(closeButton);
    dialogContents.setCellHorizontalAlignment(closeButton, HasHorizontalAlignment.ALIGN_RIGHT);
    dialogBox.addStyleName("errorBox inconsolataNormal");
    // Return the dialog box
    return dialogBox;
}
 
Example 4
Source File: BlocklyPanel.java    From appinventor-extensions with Apache License 2.0 2 votes vote down vote up
/**
 * Hide a dialog box. This function is here so it can be called from
 * the blockly code. We cannot call "hide" directly from the blockly
 * code because when this code is compiled, the "hide" method disappears!
 *
 * @param dialog The dialogbox to hide.
 */

public static void HideDialog(DialogBox dialog) {
  ConnectProgressBar.tempHide(false); // unhide the progress bar if it was hidden
  dialog.hide();
}