本文整理匯總了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();
}