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

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


    CellPanel spacerPanel = new HorizontalPanel();
    spacerPanel.setSpacing(10);
    spacerPanel.add(new Label());
    topPanel.add(spacerPanel);
    topPanel.add(reportPanel);
    final RootPanel root = RootPanel.get();

    root.add(topPanel);

    statusLabel = new HTML("Select a report.");
    root.add(statusLabel);
  }
View Full Code Here


  public Widget getWidget() {
    return root;
  }

  public void run() {
    RootPanel root = RootPanel.get();

    // Add a large widget to the root to reflect a typical application.
    FlowPanel largeWidget = null;
    if (includeLargeWidget.getValue()) {
      largeWidget = new FlowPanel();
      TestWidgetBinder.Maker widgetMaker = new TestWidgetBinder.Maker();
      for (int i = 0; i < 100; i++) {
        largeWidget.add(widgetMaker.make());
      }
      root.add(largeWidget);
    }

    int nanosCount = nanos.size();
    double[] times = new double[nanosCount];

    int column = grid.getColumnCount();
    grid.resizeColumns(column + 1);
    grid.setText(0, column, "Run " + (column - 3));

    final int instances = getInstances();
    boolean forward = false;
    for (int i = 0; i < instances; ++i) {
      forward = !forward;
      for (int m = 0; m < nanosCount; m++) {
        /*
         * Alternate the order that we invoke the makers to cancel out the
         * performance impact of adding elements to the DOM, which would cause
         * later tests to run more slowly than earlier tests.
         */
        NanoTest nano = nanos.get(forward ? m : (nanosCount - 1 - m));
        nano.setup();

        // Execute the test.
        log(i + ": " + nano.name);
        double start = Duration.currentTimeMillis();
        nano.runTest();

        // Record the end time.
        double thisTime = Duration.currentTimeMillis() - start;
        times[m] += thisTime;

        // Cleanup after the test.
        nano.teardown();
      }
    }

    // Record the times.
    double allTimes = 0;
    for (int m = 0; m < nanosCount; ++m) {
      record(m + 1, times[m]);
      allTimes += times[m];
    }
    grid.setText(grid.getRowCount() - 1, grid.getColumnCount() - 1, Util.format(allTimes));

    // Cleanup the dom.
    if (largeWidget != null) {
      root.remove(largeWidget);
    }
  }
View Full Code Here

        // iview is focused when created so element needs tabIndex
        // 1 due 0 is at the end of natural tabbing order
        DOM.setElementProperty(getElement(), "tabIndex", "1");

        RootPanel root = RootPanel.get(elementId);
        root.add(this);
        root.removeStyleName("v-app-loading");

        BrowserInfo browser = BrowserInfo.get();

        // set focus to iview element by default to listen possible keyboard
        // shortcuts
View Full Code Here

  /**
   * This is the entry point method.
   */
  public void onModuleLoad() {
    final RootPanel rootPanel = RootPanel.get();
    final LoginPanel loginPanel = new LoginPanel(new LoginPanel.LoginHandler() {
      public void onFailure() {
      }

      public void onSuccess(User user) {
        rootPanel.clear();
        rootPanel.add(new ContactList(new ConversationManager(new Model(user))));
      }
    });
    rootPanel.add(loginPanel);
    loginPanel.setFocus(true);
  }
View Full Code Here

        main.draw();

        // Add history listener
        History.addHistoryListener(this);

        RootPanel p = RootPanel.get("loadingWrapper");
        if (p != null) RootPanel.getBodyElement().removeChild(p.getElement());
    }
View Full Code Here

public class Container implements EntryPoint {

  @Override
  public void onModuleLoad() {
    final Bootstrapper bootstrapper = GWT.create(Bootstrapper.class);
    final RootPanel rootPanel = RootPanel.get();
    final InterfaceInjectionContext ctx = bootstrapper.bootstrapContainer();

    for (Widget w : ctx.getToRootPanel()) {
      rootPanel.add(w);
    }

    for (Map.Entry<Widget, String> entry : ctx.getWidgetToPanel().entrySet()) {
      ctx.getPanels().get(entry.getValue()).add(entry.getKey());
    }
View Full Code Here

                .setHref("http://code.google.com/p/choosel/source/browse/trunk/"
                        + "org.thechiselgroup.choosel.protovis/examples/"
                        + "org/thechiselgroup/choosel/protovis/client/"
                        + example.getSourceCodeFile());

        RootPanel rootPanel = RootPanel.get("visualization");
        if (rootPanel.getWidgetCount() > 0) {
            rootPanel.remove(0);
        }
        rootPanel.add(example.asWidget());
    }
View Full Code Here

        }
        public void onSuccess(LoginInfo result) {
          loginInfo = result;
          if(loginInfo.isLoggedIn()) {
          //A�adiendo elementos al RootPanel
          RootPanel rootPanel = RootPanel.get();
          TabPanel tabpanel = new TabPanel();
          signOutLink.setHref(loginInfo.getLogoutUrl());
          buscarLibros = new BuscarLibros();
          tabpanel.add(buscarLibros, "Buscar Libros");
          tabpanel.add(venderLibros, "Vender Libros");
          tabpanel.selectTab(0);
          rootPanel.add(new HTML(loginInfo.getNickname()));
          rootPanel.add(signOutLink);
          rootPanel.add(tabpanel);
          } else {
        //A�adiendo elementos al RootPanel
        RootPanel rootPanel = RootPanel.get();
        TabPanel tabpanel = new TabPanel();
        buscarLibros = new BuscarLibros();
        loadLogin();
          tabpanel.add(buscarLibros, "Buscar Libros");
          tabpanel.add(loginPanel, "Inicia Sesion");
          tabpanel.selectTab(0);
          rootPanel.add(tabpanel);
          }
        }
      });
   
   
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

     * Shows the dialog.<p>
     */
    public void show() {

        if (m_isFrame) {
            RootPanel root = RootPanel.get();
            root.getElement().getStyle().setMargin(0, Unit.PX);
            root.getElement().getStyle().setPadding(0, Unit.PX);
            RootPanel.get().add(m_main);
            m_isShowing = true;
            Scheduler.get().scheduleDeferred(new ScheduledCommand() {

                public void execute() {
View Full Code Here

TOP

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

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.