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

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


    }
    private final TextArea textArea = new TextArea();

    private void alert(String message) {
        if (GWT.isScript()) {
            RootPanel debugDiv = RootPanel.get("debug");
            if (debugDiv != null) {
//        if(debugDiv.getWidgetIndex(textArea)==-1)
//        {
//          textArea.setVisibleLines(30);
//          textArea.setWidth("100%");
View Full Code Here


        this.pageID = pageID;

        // setup the StatusPanel. There will be just one DIV for this, no
        // matter how many apps we have in the same page.
        try {
            RootPanel status = RootPanel.get("gwt-status");
            if (status.getWidgetCount() == 0) {
                StatusPanel sp = new StatusPanel();
                status.add(sp);
                StdAsyncCallback.setManager(sp);
            }

        } catch (Exception e) {
            Log.error("Status Panel problem: ");
View Full Code Here

/**
* Entry point classes define <code>onModuleLoad()</code>.
*/
public class CurrencyWidgetDemo implements EntryPoint {
  public void onModuleLoad() {
    RootPanel rootPanel = RootPanel.get();

    final Label currencyInputWidgetLabel = new Label("Currency Input Widget:");
    rootPanel.add(currencyInputWidgetLabel, 50, 32);

    final CurrencyWidget currencyWidget = new CurrencyWidget("EUR");
    rootPanel.add(currencyWidget, 50, 56);
   
    final Button clickMeButton = new Button();
    rootPanel.add(clickMeButton, 250, 56);
    clickMeButton.setText("See what you got!");
    clickMeButton.addClickListener(new ClickListener() {
      public void onClick(Widget sender) {
        Window.alert("You entered: " + Double.toString(currencyWidget.getAmount()));
      }
    });


    final Label currencyWidgetWithPreviewLabel = new Label("Currency Widget With Preview");
    rootPanel.add(currencyWidgetWithPreviewLabel, 50, 108);

    final CurrencyWidgetWithPreview currencyWidgetWithPreview = new CurrencyWidgetWithPreview("EUR");
    rootPanel.add(currencyWidgetWithPreview, 50, 132);
    currencyWidgetWithPreview.setSize("156px", "18px");

    final Button seeWhatYouButton = new Button();
    rootPanel.add(seeWhatYouButton, 250, 132);
    seeWhatYouButton.setSize("157px", "24px");
    seeWhatYouButton.setText("See what you got!");
    seeWhatYouButton.addClickListener(new ClickListener() {
      public void onClick(Widget sender) {
        Window.alert("You entered: " + Double.toString(currencyWidgetWithPreview.getAmount()));
      }
    });

   
    final Label aNaiveTextLabel = new Label("A Naive Text Widget:");
    rootPanel.add(aNaiveTextLabel, 50, 180);
    final TextBox textBox = new TextBox();
    rootPanel.add(textBox, 50, 204);
  }
View Full Code Here

        }

        DOM.sinkEvents(getWidget().getElement(), Event.ONKEYDOWN
                | Event.ONSCROLL);

        RootPanel root = RootPanel.get(rootPanelId);

        // Remove the v-app-loading or any splash screen added inside the div by
        // the user
        root.getElement().setInnerHTML("");

        // Activate the initial theme by only adding the class name. Not calling
        // activateTheme here as it will also cause a full layout and updates to
        // the overlay container which has not yet been created at this point
        activeTheme = applicationConnection.getConfiguration().getThemeName();
        root.addStyleName(activeTheme);

        root.add(getWidget());

        // Set default tab index before focus call. State change handler
        // will update this later if needed.
        getWidget().setTabIndex(1);
View Full Code Here

            }
        }
        if (w == null) {
            // Check if the element is part of a widget that is attached
            // directly to the root panel
            RootPanel rootPanel = RootPanel.get();
            int rootWidgetCount = rootPanel.getWidgetCount();
            for (int i = 0; i < rootWidgetCount; i++) {
                Widget rootWidget = rootPanel.getWidget(i);
                if (rootWidget.getElement().isOrHasChild(targetElement)) {
                    // The target element is contained by this root widget
                    w = findParentWidget(targetElement, rootWidget);
                    break;
                }
View Full Code Here

    NodeList<Element> inputs = RootPanel.get(elementId).getElement().getElementsByTagName("input");
    for (int i = 0; i < inputs.getLength(); i++) {
      Element e = inputs.getItem(i);
      if (e.getAttribute("name").compareTo("pageTitle") == 0) {
        Window.setTitle(e.getAttribute("value"));
        RootPanel htmlTitlePanel=RootPanel.get("topbar");
        if(htmlTitlePanel!=null){
          if(htmlTitlePanel.getElement().getElementsByTagName("h1").getLength()==1){
            htmlTitlePanel.getElement().getElementsByTagName("h1").getItem(0).setInnerHTML(e.getAttribute("value"));
          }
        }
      }
    }
  }
View Full Code Here

   
    /*
     * LAYOUT SCREEN
     * Generic Root Panel
     */
    RootPanel rootPanel = RootPanel.get();   
    VerticalPanel verticalPanel = new VerticalPanel();
    verticalPanel.setStyleName("tableEntryPoint");
    rootPanel.add(verticalPanel, 10, 10);
    verticalPanel.setSize("502px", "171px");
    Label lblAsignarBloque = new Label("ReAsignar Horario Medico");
    lblAsignarBloque.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT);
    lblAsignarBloque.setStyleName("lztitulo-formulario");
    verticalPanel.add(lblAsignarBloque);
View Full Code Here

    /**
     * This is the entry point method.
     */
    public void onModuleLoad()
    {
        RootPanel consoleArea = RootPanel.get("console");
        RootPanel appURL = RootPanel.get("sw-app-url");
        if (appURL == null)
        {
            RootPanel.get().add(new Label("sw-app-url element must be defined"));
        } else
        {
            String url = DOM.getAttribute(appURL.getElement(), "content");
            if (url == null)
            {
                RootPanel.get().add(new Label("sw-app-url element must be defined"));
            } else
            {
View Full Code Here

* This {@link EntryPoint} will receive control if Gears is not available on the
* browser that will run the application.
*/
public class WorkerPoolDemoNoGears implements EntryPoint {
  public void onModuleLoad() {
    RootPanel rootPanel = RootPanel.get("demo");
    rootPanel.add(new HTML(
        "<font color=\"red\">ERROR: This browser does not support Google Gears."
        + "  Please install Gears and reload the application."
        + "  Note that GWT Gears applications can only be debugged in hosted mode on Windows.</font>"));
  }
View Full Code Here


  }-*/;

  private void addLoginPanel() {
    RootPanel rootPanel = RootPanel.get("login_area");
    Label nicknameLabel = new Label("Nickname:");
    nicknameLabel.addStyleName("instructions-style");
    final TextBox nicknameTextBox = new TextBox();
    Label passwordLabel = new Label("Password:");
    passwordLabel.addStyleName("instructions-style");
    final PasswordTextBox password = new PasswordTextBox();

    ClickHandler loginHander = new ClickHandler() {

      @Override
      public void onClick(ClickEvent event) {
        String nickname = nicknameTextBox.getText();
        String passwordS = password.getText();

        AsyncCallback<Player> callback = new AsyncCallback<Player>() {

          @Override
          public void onSuccess(Player result) {
            if (result != null) {
              Cookies.setCookie("nickname", result.getNickname());
              Cookies.setCookie("highscore", result.getHighscore() + "");
              Window.Location.reload();
            }
            else {
              showErrorModal();
              //Window.alert("Wrong user name or password");
            }
          }

          @Override
          public void onFailure(Throwable caught) {

          }
        };
        _datastoreService.retrievePlayer(nickname, passwordS, callback);
      }
    };
    Button login = new Button("login", loginHander);
    login.addStyleName("button");
    Label registered = new Label("If youre registered, why not login?");
    registered.addStyleName("instructions-style");
    HorizontalPanel hPanel = new HorizontalPanel();
    hPanel.setSpacing(2);
    hPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
    hPanel.add(nicknameLabel);
    hPanel.add(nicknameTextBox);
    hPanel.add(passwordLabel);
    hPanel.add(password);
    hPanel.add(login);
    hPanel.add(registered);
    rootPanel.add(hPanel);
    rootPanel.getElement().setAttribute("style", "visibility: visible");

  }
View Full Code Here

TOP

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

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.