本文整理匯總了Java中com.google.gwt.user.client.ui.DialogBox.hide方法的典型用法代碼示例。如果您正苦於以下問題:Java DialogBox.hide方法的具體用法?Java DialogBox.hide怎麽用?Java DialogBox.hide使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.google.gwt.user.client.ui.DialogBox
的用法示例。
在下文中一共展示了DialogBox.hide方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: showIntroDialogBox
import com.google.gwt.user.client.ui.DialogBox; //導入方法依賴的package包/類
private void showIntroDialogBox() {
if (config.getIntroMessage() == null)
return;
final DialogBox dialogBox = new DialogBox(true, true);
VerticalPanel dialogBoxContents = new VerticalPanel();
dialogBox.setText(I18nUtils.tr("welcome"));
HTML message = new HTML(config.getIntroMessage());
Button button = new Button(I18nUtils.tr("ok"), new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
dialogBox.hide();
}
});
dialogBox.setWidth("400px");
dialogBoxContents.add(message);
dialogBoxContents.add(button);
dialogBox.setWidget(dialogBoxContents);
dialogBox.center();
}
示例2: createDialogCloseButton
import com.google.gwt.user.client.ui.DialogBox; //導入方法依賴的package包/類
/**
* 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();
}
} );
}
示例3: alertWidget
import com.google.gwt.user.client.ui.DialogBox; //導入方法依賴的package包/類
public static DialogBox alertWidget(final String header, final String content) {
final DialogBox dialogBox = new DialogBox();
final VerticalPanel verticalPanel = new VerticalPanel();
final Label emptyLabel = new Label("");
emptyLabel.setSize("auto", "25px");
dialogBox.setText(header);
verticalPanel.add(emptyLabel);
verticalPanel.add(new Label(content));
verticalPanel.add(emptyLabel);
final Button buttonClose = new Button("Close", new ClickHandler() {
@Override
public void onClick(final ClickEvent event) {
dialogBox.hide();
}
});
buttonClose.setWidth("100px");
verticalPanel.add(buttonClose);
verticalPanel.setCellHorizontalAlignment(buttonClose, HasAlignment.ALIGN_CENTER);
dialogBox.add(verticalPanel);
dialogBox.setWidth("400px");
return dialogBox;
}
示例4: alertWidget
import com.google.gwt.user.client.ui.DialogBox; //導入方法依賴的package包/類
/**
* Creates a DialogBox object with the specified header and content and
* returns it to be displayed.
*
* @param header
* Title for the alert dialog
* @param content
* Inner message content to display
* @return A DialogBox object configured with the specified strings
*/
public static DialogBox alertWidget(final String header,
final String content) {
final DialogBox dialogBox = new DialogBox();
final VerticalPanel verticalPanel = new VerticalPanel();
final Label emptyLabel = new Label("");
emptyLabel.setSize("auto", "25px");
dialogBox.setText(header);
verticalPanel.add(emptyLabel);
verticalPanel.add(new Label(content));
verticalPanel.add(emptyLabel);
final Button buttonClose = new Button("Close", new ClickHandler() {
@Override
public void onClick(final ClickEvent event) {
dialogBox.hide();
}
});
buttonClose.setWidth("100px");
verticalPanel.add(buttonClose);
verticalPanel.setCellHorizontalAlignment(buttonClose,
HasAlignment.ALIGN_CENTER);
dialogBox.add(verticalPanel);
return dialogBox;
}
示例5: linkTo
import com.google.gwt.user.client.ui.DialogBox; //導入方法依賴的package包/類
private void linkTo() {
// Create URL
String url = new PlannerState(getPlanRequestBean()).getUrl();
// Display dialog box
final DialogBox dialogBox = new DialogBox(true, true);
VerticalPanel dialogBoxContents = new VerticalPanel();
dialogBoxContents.setWidth("100%");
dialogBox.setText(I18nUtils.tr("link.to.this.page"));
Label message = new Label(I18nUtils.tr("copy.paste.link.hint"));
dialogBoxContents.add(message);
final TextBox urlTextBox = new TextBox();
urlTextBox.setText(url);
urlTextBox.setWidth("100%");
dialogBoxContents.add(urlTextBox);
Scheduler.get().scheduleDeferred(new ScheduledCommand() {
@Override
public void execute() {
urlTextBox.selectAll();
urlTextBox.setFocus(true);
}
});
Button button = new Button(I18nUtils.tr("ok"), new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
dialogBox.hide();
}
});
dialogBoxContents.add(button);
dialogBox.setWidth("400px");
dialogBox.setWidget(dialogBoxContents);
dialogBox.center();
}
示例6: HideDialog
import com.google.gwt.user.client.ui.DialogBox; //導入方法依賴的package包/類
/**
* 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) {
dialog.hide();
}