Package com.google.gwt.user.client.ui

Examples of com.google.gwt.user.client.ui.DialogBox$MouseHandler


    callback.result(false, appUser);
  }

  public static void doEditDialog(AppUser appUser, final RemoteDataServiceAsync remoteService)
  {
    final DialogBox dialogBox = new DialogBox();
    dialogBox.setText("Edit User Information");

    // Create a table to layout the content
    UserEdit pet = new UserEdit(appUser, new UserEdit.DialogCallback()
    {

      @Override
      public void result(boolean ok, AppUser appUser)
      {
        if (ok)
        {
          remoteService.writeAppUser(appUser, new AsyncCallback<Void>()
          {

            @Override
            public void onFailure(Throwable caught)
            {

            }

            @Override
            public void onSuccess(Void result)
            {
              dialogBox.hide();

            }

          });
        } else
        {
          dialogBox.hide();
        }

      }
    });

    pet.setWidth("100%");
    dialogBox.setWidget(pet);
    dialogBox.center();
    dialogBox.show();

  }
View Full Code Here


  }

  public static void doAddDialog(final AppUser adminAppUser, final RemoteDataServiceAsync remoteService)
  {
    final DialogBox dialogBox = new DialogBox();
    dialogBox.setText("Add New User");

    // Create a table to layout the content
    UserEdit pet = new UserEdit(new UserEdit.DialogCallback()
    {

      @Override
      public void result(boolean ok, AppUser appUser)
      {
        if (ok)
        {
          appUser.adminAppUserId = adminAppUser.id;

          remoteService.addAppUser(appUser, new AsyncCallback<Void>()
          {

            @Override
            public void onFailure(Throwable caught)
            {

            }

            @Override
            public void onSuccess(Void result)
            {
              dialogBox.hide();

            }

          });
        } else
        {
          dialogBox.hide();
        }

      }
    });

    pet.setWidth("100%");
    dialogBox.setWidget(pet);
    dialogBox.center();
    dialogBox.show();

  }
View Full Code Here

  }

  public static void doDialog(final LoginInfo loginInfo, final String packageName, final DialogCallback callback)
  {

    final DialogBox dialogBox = new DialogBox();
    dialogBox.setText(constants.mappingListLabelTitle(packageName));

    MappingList mappinglist = new MappingList(loginInfo, packageName, new DialogCallback()
    {

      @Override
      public void closed()
      {
        dialogBox.hide();
        callback.closed();
      }
    });

    mappinglist.setHeight(Window.getClientHeight() - 50 + "px");

    mappinglist.setWidth("500px");
    dialogBox.setWidget(mappinglist);
    dialogBox.center();
    dialogBox.show();
  }
View Full Code Here

    callback.result(false, textBox.getText());
  }

  public static void doInput(String caption, String label, String value, DialogCallback callback)
  {
    dialogBox = new DialogBox();
    dialogBox.setText(caption);

    InputDialog input = new InputDialog(label, value, callback);
    input.setWidth("100%");
    dialogBox.setWidget(input);
View Full Code Here

  }

  public static void doEditDialog(LoginInfo loginInfo, String packageName, final DialogCallback callback)
  {

    final DialogBox dialogBox = new DialogBox();
    dialogBox.setText(constants.mappingUploadLabelTitle(packageName));

    // Create a table to layout the content
    MappingUpload pet = new MappingUpload(loginInfo, packageName, new MappingUpload.DialogCallback()
    {

      @Override
      public void result(boolean ok)
      {
        dialogBox.hide();
        callback.result(ok);
      }
    });

    pet.setWidth("100%");
    dialogBox.setWidget(pet);
    dialogBox.center();
    dialogBox.show();

  }
View Full Code Here

    mCallback.result(false);
  }

  public static void doDialog(LoginInfo loginInfo, AppPackage appPackage, List<String> reportIds, final RemoteDataServiceAsync remoteService, final DialogCallback callback)
  {
    final DialogBox dialogBox = new DialogBox();
    dialogBox.setText(constants.emailLabelSend(appPackage.AppName));

    // Create a table to layout the content
    EMailTemplateSend pet = new EMailTemplateSend(loginInfo, appPackage, reportIds, remoteService, new EMailTemplateSend.DialogCallback()
    {

      @Override
      public void result(boolean ok)
      {
        if (ok)
        {
          dialogBox.hide();
        } else
        {
          dialogBox.hide();
        }

      }
    });

    pet.setWidth("100%");
    dialogBox.setWidget(pet);
    dialogBox.center();
    dialogBox.show();

  }
View Full Code Here

  }

  public static void doDialog(LoginInfo loginInfo, AppPackage appPackage, ACRALog acraLog, final RemoteDataServiceAsync remoteService, final DialogCallback callback)
  {
    final DialogBox dialogBox = new DialogBox();
    dialogBox.setText(constants.emailLabelSend(appPackage.AppName));

    // Create a table to layout the content
    EMailTemplateSend pet = new EMailTemplateSend(loginInfo, appPackage, acraLog, remoteService, new EMailTemplateSend.DialogCallback()
    {

      @Override
      public void result(boolean ok)
      {
        if (ok)
        {
          dialogBox.hide();
        } else
        {
          dialogBox.hide();
        }

      }
    });

    pet.setWidth("680px");
    dialogBox.setWidget(pet);
    dialogBox.center();
    dialogBox.show();

  }
View Full Code Here

    // Focus the cursor on the name field when the app loads
    nameField.setFocus(true);//(5)
    nameField.selectAll();

    // Create the popup dialog box
    final DialogBox dialogBox = new DialogBox(); //(6)
    dialogBox.setText("Remote Procedure Call");
    dialogBox.setAnimationEnabled(true);
    final Button closeButton = new Button("Close");//(7)
    // We can set the id of a widget by accessing its Element
    closeButton.getElement().setId("closeButton");
    final Label textToServerLabel = new Label();
    final HTML serverResponseLabel = new HTML();
    VerticalPanel dialogVPanel = new VerticalPanel();//(8)
    dialogVPanel.addStyleName("dialogVPanel");
    dialogVPanel.add(new HTML("<b>Sending name to the server:</b>"));
    dialogVPanel.add(textToServerLabel);
    dialogVPanel.add(new HTML("<br><b>Server replies:</b>"));
    dialogVPanel.add(serverResponseLabel);
    dialogVPanel.setHorizontalAlignment(VerticalPanel.ALIGN_RIGHT);
    dialogVPanel.add(closeButton);
    dialogBox.setWidget(dialogVPanel); //(9)

    closeButton.addClickHandler(new ClickHandler() { //(10)
      public void onClick(ClickEvent event) {
        dialogBox.hide();
        sendButton.setEnabled(true);
        sendButton.setFocus(true);
      }
    });


    // Create a handler for the sendButton and nameField
    class MyHandler implements ClickHandler, KeyUpHandler {
      /**
       * Fired when the user clicks on the sendButton.
       */
      public void onClick(ClickEvent event) {
        sendNameToServer();
      }

      /**
       * Fired when the user types in the nameField.
       */
      public void onKeyUp(KeyUpEvent event) {
        if (event.getNativeKeyCode() == KeyCodes.KEY_ENTER) {
          sendNameToServer();
        }
      }

      /**
       * Send the name from the nameField to the server and wait for a response.
       */
      private void sendNameToServer() {
        sendButton.setEnabled(false);
        String textToServer = nameField.getText();
        textToServerLabel.setText(textToServer);
        serverResponseLabel.setText("");
        greetingService.greetServer(textToServer,
            new AsyncCallback<String>() {
              public void onFailure(Throwable caught) {
                // Show the RPC error message to the user
                dialogBox
                    .setText("Remote Procedure Call - Failure");
                serverResponseLabel
                    .addStyleName("serverResponseLabelError");
                serverResponseLabel.setHTML(SERVER_ERROR);
                dialogBox.center();
                closeButton.setFocus(true);
              }

              public void onSuccess(String result) {
                dialogBox.setText("Remote Procedure Call");
                serverResponseLabel
                    .removeStyleName("serverResponseLabelError");
                serverResponseLabel.setHTML(result);
                dialogBox.center();
                closeButton.setFocus(true);
              }
            });
      }
    }
View Full Code Here

    // Focus the cursor on the name field when the app loads
    nameField.setFocus(true);
    nameField.selectAll();

    // Create the popup dialog box
    final DialogBox dialogBox = new DialogBox();
    dialogBox.setText("Remote Procedure Call");
    dialogBox.setAnimationEnabled(true);
    final Button closeButton = new Button("Close");
    // We can set the id of a widget by accessing its Element
    closeButton.getElement().setId("closeButton");
    final Label textToServerLabel = new Label();
    final HTML serverResponseLabel = new HTML();
    VerticalPanel dialogVPanel = new VerticalPanel();
    dialogVPanel.addStyleName("dialogVPanel");
    dialogVPanel.add(new HTML("<b>Sending name to the server:</b>"));
    dialogVPanel.add(textToServerLabel);
    dialogVPanel.add(new HTML("<br><b>Server replies:</b>"));
    dialogVPanel.add(serverResponseLabel);
    dialogVPanel.setHorizontalAlignment(VerticalPanel.ALIGN_RIGHT);
    dialogVPanel.add(closeButton);
    dialogBox.setWidget(dialogVPanel);

    // Add a handler to close the DialogBox
    closeButton.addClickHandler(new ClickHandler() {
      public void onClick(ClickEvent event) {
        dialogBox.hide();
        sendButton.setEnabled(true);
        sendButton.setFocus(true);
      }
    });

    // Create a handler for the sendButton and nameField
    class MyHandler implements ClickHandler, KeyUpHandler {
      /**
       * Fired when the user clicks on the sendButton.
       */
      public void onClick(ClickEvent event) {
        //sendNameToServer();
      }

      /**
       * Fired when the user types in the nameField.
       */
      public void onKeyUp(KeyUpEvent event) {
        if (event.getNativeKeyCode() == KeyCodes.KEY_ENTER) {
          // sendNameToServer();
        }
      }

      /**
       * Send a chat message to the server.
       */
      private void postMessage(ChatMessage msg) {
        sendButton.setEnabled(false);
        String textToServer = nameField.getText();
        textToServerLabel.setText(textToServer);
        serverResponseLabel.setText("");
       
        chatService.postMessage(msg, new AsyncCallback<List<ChatMessage>>() {
              public void onFailure(Throwable caught) {
                // Show the RPC error message to the user
                dialogBox
                    .setText("Remote Procedure Call - Failure");
                serverResponseLabel
                    .addStyleName("serverResponseLabelError");
                serverResponseLabel.setHTML(SERVER_ERROR);
                dialogBox.center();
                closeButton.setFocus(true);
              }

              public void onSuccess(List<ChatMessage> newMessages) {
                PersistChat.this.AddPostedMessages(newMessages);
View Full Code Here

  int statusCode = 0;
  DialogBox timeoutDB;
  Label timeoutMessage;

  private void createConnectAttemptGUI() {
    timeoutDB = new DialogBox();
    timeoutMessage = new Label();
    timeoutDB.add(timeoutMessage);
    RootPanel.get().add(timeoutDB);
    timeoutDB.show();
    timeoutDB.center();
View Full Code Here

TOP

Related Classes of com.google.gwt.user.client.ui.DialogBox$MouseHandler

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.