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

Examples of com.google.gwt.user.client.ui.HTML


    private HTML notice;

    // Not using Vaadin notifications (#14597)
    private  void notice(String productName) {
        if (notice == null) {
            notice = new HTML();
            notice.addClickHandler(new ClickHandler() {
                public void onClick(ClickEvent event) {
                    notice.removeFromParent();
                }
            });
View Full Code Here


    @SuppressWarnings("unused")
    public VMyDragSource() {
        FlowPanel fp = new FlowPanel();
        initWidget(fp);

        HTML html = new HTML("DragThis");

        fp.add(html);

        html.addMouseDownHandler(this);
        html.addMouseMoveHandler(this);
        html.addMouseOutHandler(this);

    }
View Full Code Here

    }

    public void updateMessage(String htmlErrorMessage) {
        clear();
        if (htmlErrorMessage == null || htmlErrorMessage.length() == 0) {
            add(new HTML(" "));
        } else {
            // pre-formatted on the server as div per child
            add(new HTML(htmlErrorMessage));
        }
    }
View Full Code Here

    protected void extend(ServerConnector target) {
        final Widget passwordWidget = ((ComponentConnector) target).getWidget();

        final VOverlay warning = new VOverlay();
        warning.setOwner(passwordWidget);
        warning.add(new HTML("Caps Lock is enabled!"));

        passwordWidget.addDomHandler(new KeyPressHandler() {
            @Override
            public void onKeyPress(KeyPressEvent event) {
                if (isEnabled() && isCapsLockOn(event)) {
View Full Code Here

* Test microformat import facility
*/
public class MicroformatsTest extends ChronoscopeTestCaseBase {
 
  public void testCustomDateTimeFormat() {
     HTML data = new HTML(Fixtures.microformatData);
     RootPanel.get().add(data);
     delayTestFinish(15000);
     Chronoscope.setMicroformatsEnabled(true);
     Microformats.setMicroformatsReadyListener(new Command() {
       public void execute() {
View Full Code Here

                    }
                  });
                  RootPanel.get().add(cp);
                } catch (Throwable e) {
                  setTitle.setTitle("Chronoscope: Error in Data");
                  RootPanel.get().add(new HTML(
                      "There was an error parsing the spreadsheet data. See <a href=\"http://spreadsheets.google.com/pub?key=pChH4pq_9_M63rOylnhf0KQ\">this Google Spreadsheet</a> for an example how of to format the data correctly. The data range must include the header rows as well as the data rows."));
                }
              }
            });
      }
View Full Code Here

    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() {
      @Override
      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.
       */
      @Override
      public void onClick(ClickEvent event) {
        sendNameToServer();
      }

      /**
       * Fired when the user types in the nameField.
       */
      @Override
      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() {
        // First, we validate the input.
        errorLabel.setText("");
        String textToServer = nameField.getText();
        if (!FieldVerifier.isValidName(textToServer)) {
          errorLabel.setText("Please enter at least four characters");
          return;
        }

        // Then, we send the input to the server.
        sendButton.setEnabled(false);
        textToServerLabel.setText(textToServer);
        serverResponseLabel.setText("");

        UserRequest userContext = requests.userRequest();
        UserProxy user = userContext.create(UserProxy.class);
        user.setName(textToServer);
        userContext.save(user).fire(new Receiver<Long>() {
View Full Code Here

    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 the name from the nameField to the server and wait for a response.
       */
      private void sendNameToServer() {
        // First, we validate the input.
        errorLabel.setText("");
        String textToServer = nameField.getText();
        if (!FieldVerifier.isValidName(textToServer)) {
          errorLabel.setText("Please enter at least four characters");
          return;
        }
       
        // Then, we send the input to the server.
        sendButton.setEnabled(false);
        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

   *
   */
  ResourceViewer(boolean useDecoratorPanel, boolean useScroller) {
    super();
   
    bodyHtml = new HTML();
//      bodyHtml.setWidth("700px");
   
    if ( useDecoratorPanel ) {
      CellPanel p = new VerticalPanel();
      DecoratorPanel decPanel = new DecoratorPanel();
View Full Code Here

   
    if ( error == null ) {

      String uri = uploadOntologyResult.getUri();

      vp.add(new HTML("<font color=\"green\">Congratulations!</font> "
          + "Your ontology is now registered."
      ));
     
     
      vp.add(new HTML("<br/>The URI of the ontology is: "
//          + "<a href=\"" +uri+ "\">"
          + uri
//          + "</a>"
      ));
     
     
      vp.add(new HTML("<br/>For diagnostics, this is the response from the back-end server:"));

      sb.append(uploadOntologyResult.getInfo());
     
      // and, disable all editing fields/buttons:
      // (user will have to start from the "load" step)
View Full Code Here

TOP

Related Classes of com.google.gwt.user.client.ui.HTML

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.