本文整理汇总了Java中com.google.gwt.user.client.ui.DialogBox.add方法的典型用法代码示例。如果您正苦于以下问题:Java DialogBox.add方法的具体用法?Java DialogBox.add怎么用?Java DialogBox.add使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.gwt.user.client.ui.DialogBox
的用法示例。
在下文中一共展示了DialogBox.add方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createLyricsDialog
import com.google.gwt.user.client.ui.DialogBox; //导入方法依赖的package包/类
private void createLyricsDialog()
{
lyricsDialog = new DialogBox();
VerticalPanel vPanel = new VerticalPanel();
vPanel.setHeight( "100%" );
vPanel.setHorizontalAlignment( VerticalPanel.ALIGN_CENTER );
vPanel.setVerticalAlignment( VerticalPanel.ALIGN_MIDDLE );
lyricsDialog.add( vPanel );
lyrics = new HTML();
ScrollPanel scrollPanel = new ScrollPanel();
scrollPanel.setWidth( "300px" );
scrollPanel.setHeight( "250px" );
scrollPanel.add( lyrics );
vPanel.add( scrollPanel );
Button close = new NativeButton( "Close" );
close.addClickListener( new ClickListener() {
public void onClick( Widget arg0 ) {
lyricsDialog.hide();
}
} );
vPanel.add( close );
}
示例2: 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();
}
} );
}
示例3: showProposals
import com.google.gwt.user.client.ui.DialogBox; //导入方法依赖的package包/类
private void showProposals() {
proposalDialog = new DialogBox();
proposalDialog.setAnimationEnabled(true);
VerticalPanel rootPanel = new VerticalPanel();
proposalDialog.add(rootPanel);
rootPanel.add(proposalPanel);
HorizontalPanel buttonPanel = new HorizontalPanel();
rootPanel.add(buttonPanel);
Button cancelButton = new Button(I18nUtils.tr("cancel"));
buttonPanel.add(cancelButton);
cancelButton.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
hideProposals();
}
});
proposalDialog.setAutoHideEnabled(true);
proposalDialog.showRelativeTo(getAsWidget());
}
示例4: 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();
}
示例5: 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;
}
示例6: 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;
}
示例7: onModuleLoad
import com.google.gwt.user.client.ui.DialogBox; //导入方法依赖的package包/类
public void onModuleLoad() {
final DialogBox loginBox=new DialogBox();
loginBox.setAnimationEnabled(true);
loginBox.setGlassEnabled(true);
loginBox.setTitle("This panel allows you to login to the system.");
final VerticalPanel vp=new VerticalPanel();
final PasswordTextBox ptb=new PasswordTextBox();
final Button lbutton=new Button("Go");
vp.add(ptb);
vp.add(lbutton);
loginBox.add(vp);
lbutton.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
if(ptb.getText().startsWith("abracadabra")) {
user=ptb.getText().substring("abracadabra".length());
loadModule();
loginBox.hide();
}
else
Window.alert("Sorry better luck next time :)");
}
});
loginBox.center();
}