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

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


    rpc.getGoalHistory(new AsyncCallback<Bridge>() {

      @Override
      public void onSuccess(Bridge result) {
        if (result.goals.size() > 0) {
          RootPanel rootPanel = RootPanel.get("goalHistory");

          DecoratorPanel goalDecoratorPanel = new DecoratorPanel();
          rootPanel.add(goalDecoratorPanel);

          FlexTable weightFlexTable = new FlexTable();
          weightFlexTable.setSize("380px", "80px");
          goalDecoratorPanel.setWidget(weightFlexTable);
View Full Code Here


      @Override
      public void onSuccess(Bridge result) {
        if (result.meals.size() > 0) {

          RootPanel rootPanel = RootPanel.get("UserMeals");

          // DecoratorPanel goalDecoratorPanel = new DecoratorPanel();
          // rootPanel.add(goalDecoratorPanel);

          FlexTable mealsFlexTable = new FlexTable();
          // mealsFlexTable.setStyleName("cw-FlexTable");
          // mealsFlexTable.setSize("270px", "300px");
          mealsFlexTable.setWidth("390px");

          mealsFlexTable.setText(0, 0, "Name");
          mealsFlexTable.setText(0, 1, "Meal Items");
          mealsFlexTable.setText(0, 2, "Calories");

          mealsFlexTable.getCellFormatter().addStyleName(0, 0,
              "mealsListHeader");
          mealsFlexTable.getCellFormatter().addStyleName(0, 1,
              "mealsListHeader");
          mealsFlexTable.getCellFormatter().addStyleName(0, 2,
              "mealsListHeader");

          double mealCalToday = 0.0;
          int row = 0;

          for (Meal meal : result.meals) {
            row++;
            mealsFlexTable.setText(row, 0, meal.getLabel());
            mealsFlexTable.getCellFormatter().addStyleName(row, 0,
                "mealsListRow");
            String itemTitle = "";
            for (FoodItem item : meal.getFoodItems()) {
              itemTitle += item.getName() + "</br>";
            }

            HTML html = new HTML(itemTitle);

            mealsFlexTable.setWidget(row, 1, html);
            mealsFlexTable.getCellFormatter().addStyleName(row, 1,
                "mealsListRow");
            mealsFlexTable.setText(row, 2,
                String.valueOf(meal.totalCalories()));
            mealsFlexTable.getCellFormatter().addStyleName(row, 2,
                "mealsListRow");

            mealCalToday += meal.totalCalories();

          }

          Landing.mealCal = mealCalToday;

          HTML html = new HTML("</br>Total calories consumed = "
              + (int)mealCalToday);
          mealsFlexTable.setWidget(row + 1, 1, html);
          mealsFlexTable.getCellFormatter().addStyleName(row + 1, 1,
              "mealsTotalCalories");

          rootPanel.add(mealsFlexTable);
          getUserWorkout();

        }
      }
View Full Code Here

    rpc.getUserWorkouts(msg, new AsyncCallback<Bridge>() {

      @Override
      public void onSuccess(Bridge result) {
        if (result.workouts.size() > 0) {
          RootPanel rootPanel = RootPanel.get("UserWorkout");

          // DecoratorPanel goalDecoratorPanel = new DecoratorPanel();
          // rootPanel.add(goalDecoratorPanel);

          FlexTable workoutFlexTable = new FlexTable();
          workoutFlexTable.setWidth("390px");

          workoutFlexTable.setText(0, 0, "Name");
          workoutFlexTable.setText(0, 1, "Workout");
          workoutFlexTable.setText(0, 2, "Calories");

          workoutFlexTable.getCellFormatter().addStyleName(0, 0,
              "mealsListHeader");
          workoutFlexTable.getCellFormatter().addStyleName(0, 1,
              "mealsListHeader");
          workoutFlexTable.getCellFormatter().addStyleName(0, 2,
              "mealsListHeader");

          double workOutCalToday = 0.0;
          int row = 0;

          for (Workout work : result.workouts) {
            row++;
            workoutFlexTable.setText(row, 0, work.getLabel());
            workoutFlexTable.getCellFormatter().addStyleName(row,
                0, "mealsListRow");
            String itemTitle = "";
            for (ExerciseItem item : work.getExerciseItems()) {
              itemTitle += item.getName() + "</br>";
            }

            HTML html = new HTML(itemTitle);

            workoutFlexTable.setWidget(row, 1, html);
            workoutFlexTable.getCellFormatter().addStyleName(row,
                1, "mealsListRow");
            workoutFlexTable.setText(row, 2,
                String.valueOf(work.totalCaloriesBurned()));
            workoutFlexTable.getCellFormatter().addStyleName(row,
                2, "mealsListRow");

            workOutCalToday += work.totalCaloriesBurned();

          }

          Landing.workoutCal = workOutCalToday;
          HTML html = new HTML("</br>Total calories burned= "
              + (int)workOutCalToday);
          workoutFlexTable.setWidget(row + 1, 1, html);

          workoutFlexTable.getCellFormatter().addStyleName(row + 1,
              1, "mealsTotalCalories");

          rootPanel.add(workoutFlexTable);
          calculateCalorios();
        }

      }
View Full Code Here

  public void getUserName() {
    rpc.getUserName(new AsyncCallback<String>() {

      @Override
      public void onSuccess(String result) {
        RootPanel rootPanel = RootPanel.get("userName");

        FlexTable userNameFlexTable = new FlexTable();
        userNameFlexTable.setSize("200px", "60px");
        userNameFlexTable.setWidget(0, 0, new HTML("Welcome <i>"
            + result + "!</i>"));
        userNameFlexTable.setText(1, 0, "Below is your data for Today");

        rootPanel.add(userNameFlexTable);
      }

      @Override
      public void onFailure(Throwable caught) {
        // TODO Auto-generated method stub
View Full Code Here

  private void loadPage() {
    setPageHeader();
   
   
    RootPanel rootPanel = RootPanel.get("profilecont");
   
    FlexTable flexTable = new FlexTable();
    rootPanel.add(flexTable, 0, 0);
    flexTable.setSize("277px", "232px");
   
    Label lblNewLabel = new Label("First Name");
    flexTable.setWidget(0, 0, lblNewLabel);
   
View Full Code Here

   
    getUserProfile();
  }
 
  private void setPageHeader() {
    RootPanel rpanel = RootPanel.get("profileheader");
   
    HTML html = new HTML("<h3><b><font color=\"#308A4D\">Your Personal information!</font></b></h3>");
   
    rpanel.add(html);
   
  }
View Full Code Here

  private ArrayList<ExerciseItem> exercises = new ArrayList<ExerciseItem>();
  private Meal newMeal;
  private Workout newWorkout;

  private void setPageHeader() {
    RootPanel headPanel = RootPanel.get("calculatorHeader");
    headPanel
        .add(new HTML(
            "<h3><b><font color=\"#308A4D\">Enter your meals and workouts!</font></b></h3>"));
  }
View Full Code Here

    private Label m_label;
    private FlowPanel m_panel;

    public ErrorPanel()
    {
        RootPanel root = RootPanel.get("mainContent");
       
        if (root == null) {
            throw new IllegalStateException("Unable to locate the errorpanel element.  You must import spiffyui.min.js before using the MessageUtil.");
        }
        m_panel = new FlowPanel();
        m_panel.getElement().setId("errorpanel");

        m_label = new Label("", true);
        m_panel.add(m_label);

        Anchor clear = new Anchor("X");
        clear.getElement().setId("errorpanel_hide");
        clear.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent event)
            {
                event.preventDefault();
                JSUtil.slideUp("#" + m_panel.getElement().getId(), "fast");
            }
        });
        m_panel.add(clear);

        m_panel.setVisible(false);

        root.insert(m_panel, 0);
        //Any click anywhere will close
        Event.addNativePreviewHandler(this);
    }
View Full Code Here

    });
   
  }
 
  private void setPageHeader() {
    RootPanel rpanel = RootPanel.get("goalheader");
   
    HTML html = new HTML("<h3><b><font color=\"#308A4D\">Set up your new goal!</font></b></h3>");
   
    rpanel.add(html);
  }
View Full Code Here

       
      }

      @Override
      public void onSuccess(String result) {
        RootPanel rootPanel = RootPanel.get("goalCont");       
       
       
        FlexTable flexTable = new FlexTable();
        rootPanel.add(flexTable, 0, 0);
        flexTable.setSize("398px", "259px");
                       
        lblNewLabel = new Label("Current Weight:");
        flexTable.setWidget(0, 0, lblNewLabel);
       
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.