Example usage for com.google.gwt.user.client.ui DialogBox show

List of usage examples for com.google.gwt.user.client.ui DialogBox show

Introduction

In this page you can find the example usage for com.google.gwt.user.client.ui DialogBox show.

Prototype

@Override
    public void show() 

Source Link

Usage

From source file:com.vaadin.tests.widgetset.client.gwtrpc.GwtRpcButtonConnector.java

License:Apache License

private void doRPC() {
    log("GwtRpcButtonTestConnector onClick");

    GwtRpcServiceTestAsync service = GWT.create(GwtRpcServiceTest.class);

    service.giveMeThat("honey", "sugar", new AsyncCallback<String>() {

        @Override//from  w w w.  ja v  a 2  s .c  o  m
        public void onSuccess(String result) {
            showResult(result, SUCCESS_LABEL_ID);
        }

        @Override
        public void onFailure(Throwable caught) {
            showResult(caught.getMessage(), FAIL_LABEL_ID);
        }

        /*
         * Show the result box.
         */
        private void showResult(String result, String labelID) {
            DialogBox box = new DialogBox(true);
            Label label = new Label(result);
            label.getElement().setId(labelID);
            box.add(label);
            box.center();
            box.show();
        }

    });
}

From source file:com.webgocommerce.client.view.uimenu.UIMenuImpl.java

@Override
public void showTreeMenuBar() {
    List<MenuBar> lista = new ArrayList<MenuBar>();
    Iterator<MenuBarProxy> iterador = grid.getData().iterator();
    while (iterador.hasNext()) {
        MenuBarProxy beanProxy = iterador.next();
        MenuBar bean = new MenuBar();
        bean.setIdMenuBar(beanProxy.getIdMenuBar());
        bean.setVariable(beanProxy.getVariable());
        bean.setDescripcion(beanProxy.getDescripcion());
        bean.setGrupo(beanProxy.getGrupo());
        bean.setNivel(beanProxy.getNivel());
        bean.setOrden(beanProxy.getOrden());
        bean.setTipo(beanProxy.getTipo());
        bean.setNumSubMenu(beanProxy.getNumSubMenu());
        bean.setIdMenuPadre(beanProxy.getIdMenuPadre());
        lista.add(bean);/*  w ww .  j a  v a2 s  .  com*/
    }
    MenuBar root = createTree(lista.get(0), lista);
    DialogBox popup = new DialogBox();
    popup.setText("Vista previa de Menu");
    popup.setAnimationEnabled(true);
    popup.setAutoHideEnabled(true);
    popup.setGlassEnabled(true);
    ScrollPanel scroll = new ScrollPanel();
    TreeMenuModel model = new TreeMenuModel(root);
    CellTree tree = new CellTree(model, root);
    tree.setKeyboardSelectionPolicy(KeyboardSelectionPolicy.ENABLED);
    scroll.setSize("500px", "500px");
    scroll.setWidget(tree);
    popup.add(scroll);
    popup.setSize("500px", "500px");
    popup.center();
    popup.show();
}

From source file:edu.caltech.ipac.firefly.data.dyn.DynUtils.java

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);//  w  ww.ja  v  a2 s .  co m
    }

    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();
}

From source file:edu.ucdenver.bios.glimmpseweb.client.shared.CancelDialogBox.java

License:Open Source License

public Widget cancelDialogBox() {
    DialogBox dialogBox = new DialogBox();
    dialogBox.setGlassEnabled(true);//from w ww  .  jav a2s. c o m
    dialogBox.setAnimationEnabled(true);
    HTML query = new HTML(GlimmpseWeb.constants.cancelDialogBoxQuery());
    Button saveButton = new Button("Save", new ClickHandler() {
        @Override
        public void onClick(ClickEvent event) {
            // TODO Auto-generated method stub

        }

    });
    Button discardChangesButton = new Button("Discard Changes", new ClickHandler() {
        @Override
        public void onClick(ClickEvent event) {
            // TODO Auto-generated method stub

        }

    });
    Button continueButton = new Button("Continue", new ClickHandler() {
        @Override
        public void onClick(ClickEvent event) {
            // TODO Auto-generated method stub

        }

    });

    saveButton.setStyleName(STYLE_BUTTON);
    discardChangesButton.setStyleName(STYLE_BUTTON);
    continueButton.setStyleName(STYLE_BUTTON);
    HorizontalPanel horizontalPanel = new HorizontalPanel();
    horizontalPanel.add(saveButton);
    horizontalPanel.add(discardChangesButton);
    horizontalPanel.add(continueButton);
    horizontalPanel.setSpacing(10);

    VerticalPanel verticalPanel = new VerticalPanel();
    verticalPanel.add(query);
    verticalPanel.add(horizontalPanel);

    dialogBox.setText("Cancel Dialog Box");
    dialogBox.add(verticalPanel);
    dialogBox.show();

    return dialogBox;
}

From source file:fr.drop.client.content.projects.CwDialogBox.java

License:Apache License

/**
 * Initialize this example./*w w w . j  a  va  2  s .  c  o m*/
 */
@DropSource
@Override
public Widget onInitialize() {
    // Create the dialog box
    final DialogBox dialogBox = createDialogBox();
    dialogBox.setGlassEnabled(true);
    dialogBox.setAnimationEnabled(true);

    // Create a button to show the dialog Box
    Button openButton = new Button(constants.cwDialogBoxShowButton(), new ClickHandler() {
        public void onClick(ClickEvent sender) {
            dialogBox.center();
            dialogBox.show();
        }
    });

    // Create a ListBox
    HTML listDesc = new HTML("<br><br><br>" + constants.cwDialogBoxListBoxInfo());

    ListBox list = new ListBox();
    list.setVisibleItemCount(1);
    for (int i = 10; i > 0; i--) {
        list.addItem(constants.cwDialogBoxItem() + " " + i);
    }

    // Add the button and list to a panel
    VerticalPanel vPanel = new VerticalPanel();
    vPanel.setSpacing(8);
    vPanel.add(openButton);
    vPanel.add(listDesc);
    vPanel.add(list);

    // Return the panel
    return vPanel;
}

From source file:ilarkesto.gwt.client.desktop.Desktop.java

License:Open Source License

public static void showError(String message) {
    DialogBox dialog = new DialogBox(true, true);
    dialog.setText("Autsch!");
    Label messageLabel = new Label(message);
    VerticalPanel vertical = new VerticalPanel();
    vertical.getElement().getStyle().setPadding(20, Unit.PX);
    vertical.add(messageLabel);/*from   w  w  w . j  a  v  a  2s  .c o  m*/
    dialog.setWidget(vertical);
    dialog.center();
    dialog.show();
}

From source file:ilarkesto.gwt.client.desktop.Widgets.java

License:Open Source License

public static DialogBox showDialog(String title, Object message) {
    IsWidget widget = null;//from   w ww . j a v a  2  s .c o m
    if (message instanceof IsWidget)
        widget = (IsWidget) message;
    if (widget == null)
        widget = notification(message);
    DialogBox dialog = dialog(true, title, widget);
    dialog.show();
    return dialog;
}

From source file:it.unibo.cs.v2.client.NewMachineWizard.java

License:Open Source License

@Override
public void onFailure(Throwable caught) {
    DialogBox errorDialog = new DialogBox();
    errorDialog.setAnimationEnabled(true);
    errorDialog.setWidget(new HTML("An error occured while querying the RPC server, please refresh the page."));
    errorDialog.show();
}

From source file:net.officefloor.tutorial.cometmanualapp.client.CometManualAppEntryPoint.java

License:Open Source License

@Override
public void onModuleLoad() {

    // Vertically align contents
    RootPanel panel = RootPanel.get("chat");
    VerticalPanel chatPanel = new VerticalPanel();
    panel.add(chatPanel);//  w w w.  ja v  a  2 s  .c  o  m

    // Provide dialog box for user name
    final DialogBox dialogBox = new DialogBox();
    dialogBox.setModal(true);
    HorizontalPanel userNamePanel = new HorizontalPanel();
    dialogBox.add(userNamePanel);
    userNamePanel.add(new Label("Enter user name: "));
    final TextBox userNameTextBox = new TextBox();
    userNamePanel.add(userNameTextBox);
    Button userNameSubmit = new Button("submit");
    userNamePanel.add(userNameSubmit);
    dialogBox.show();
    dialogBox.center();
    userNameSubmit.addClickHandler(new ClickHandler() {
        @Override
        public void onClick(ClickEvent event) {
            CometManualAppEntryPoint.this.userNameService.login(userNameTextBox.getText(),
                    new AsyncCallback<Void>() {
                        @Override
                        public void onSuccess(Void result) {
                            dialogBox.hide();
                        }

                        @Override
                        public void onFailure(Throwable caught) {
                            Window.alert("Failed to specify user name");
                        }
                    });
        }
    });

    // Provide the text area to contain conversation
    final TextArea conversation = new TextArea();
    conversation.setReadOnly(true);
    conversation.setSize("100%", "300px");
    chatPanel.add(conversation);

    // Handle listening for messages
    OfficeFloorComet.subscribe(ConversationSubscription.class, new ConversationSubscription() {
        @Override
        public void message(ConversationMessage message) {
            conversation.setText(conversation.getText() + "\n" + message.getName() + ": " + message.getText());
        }
    }, null);

    // Provide means to add message
    HorizontalPanel messagePanel = new HorizontalPanel();
    chatPanel.add(messagePanel);
    final TextBox message = new TextBox();
    message.setWidth("80%");
    messagePanel.add(message);
    Button send = new Button("send");
    messagePanel.add(send);

    // Handle submitting a message
    final ConversationSubscription publisher = OfficeFloorComet.createPublisher(ConversationSubscription.class);
    send.addClickHandler(new ClickHandler() {
        @Override
        public void onClick(ClickEvent event) {
            String messageText = message.getText();
            publisher.message(new ConversationMessage(messageText));
        }
    });
}

From source file:net.s17fabu.vip.gwt.showcase.client.content.popups.CwDialogBox.java

License:Apache License

/**
 * Initialize this example.// ww  w .j av  a  2  s  . com
 */
@Override
public Widget onInitialize() {
    // Create the dialog box
    final DialogBox dialogBox = createDialogBox();
    dialogBox.setAnimationEnabled(true);

    // Create a button to show the dialog Box
    Button openButton = new Button(constants.cwDialogBoxShowButton(), new ClickHandler() {
        public void onClick(ClickEvent sender) {
            dialogBox.center();
            dialogBox.show();
        }
    });

    // Create a ListBox
    HTML listDesc = new HTML("<br><br><br>" + constants.cwDialogBoxListBoxInfo());

    ListBox list = new ListBox();
    list.setVisibleItemCount(1);
    for (int i = 10; i > 0; i--) {
        list.addItem(constants.cwDialogBoxItem() + " " + i);
    }

    // Add the button and list to a panel
    VerticalPanel vPanel = new VerticalPanel();
    vPanel.setSpacing(8);
    vPanel.add(openButton);
    vPanel.add(listDesc);
    vPanel.add(list);

    // Return the panel
    return vPanel;
}