public VistaListaNoticiasTecnologiaGwtImp() {

    // construir el encabezado de la vista
    tituloVista = new HTML(TITULO_VISTA);
    contenidoBarraTitulo.setCenterWidget(tituloVista);
    contenidoVentana.add(contenidoBarraTitulo);
    // desactivar desplazamiento en x
    contenedorArrastrable.setScrollingEnabledX(false);

    // botones para volver
    botonVolver.setBackButton(true);
    botonVolver.setRoundButton(true);
    botonVolver.setText("Volver");
    contenidoBarraTitulo.setLeftWidget(botonVolver);

    // inicializar el contenedor
    contenedorContenido = new FlowPanel();

    contenedorContenido.add(new HTML(" "));

    // noticias
    RoundPanel descripcionNot = new RoundPanel();
    descripcionNot.add(new HTML("Tecnología"));
    getContenedorContenido().add(descripcionNot);
    // agregar la lista al contenedor
    getContenedorContenido().add(getListaNoticiasWidget());
    // aplica esquinas redondeadas
    getListaNoticiasWidget().setRound(true);

    contenidoArrastrable.add(contenedorContenido);

    contenedorArrastrable.add(contenidoArrastrable);

    contenidoVentana.add(contenedorArrastrable);
  }
Esempio n. 2
0
 private void showMailList(List<StickMail> mails) {
   resultsPanel.clear();
   if (mails == null || mails.size() == 0) {
     Label noMailsLbl = new Label("You have no scheduled mails.");
     noMailsLbl.addStyleName("ui-nomails");
     resultsPanel.add(noMailsLbl);
     return;
   }
   deleteBtn.setVisible(true);
   SimpleContainer list = new SimpleContainer();
   for (final StickMail mail : mails) {
     HorizontalPanel row = new HorizontalPanel();
     row.addStyleName("ui-row");
     list.add(row);
     PhCheckBox check = new PhCheckBox();
     check.addValueChangeHandler(
         new ValueChangeHandler<Boolean>() {
           public void onValueChange(ValueChangeEvent<Boolean> event) {
             if (!scrollInProgress) {
               if (event.getValue()) {
                 checkedMails.add(mail);
               } else {
                 checkedMails.remove(mail);
               }
             }
           }
         });
     row.add(check);
     TouchHTML mailHtml =
         new TouchHTML(
             "<p class='ui-row-subject'>"
                 + mail.getSubject()
                 + "</p><p class='ui-row-scheduled'>"
                 + GwtUtils.dateToString(mail.getScheduled(), "dd/MM/yyyy HH:mm")
                 + "</p>");
     row.add(mailHtml);
     mailHtml.addTouchEndHandler(
         new TouchEndHandler() {
           public void onTouchEnd(TouchEndEvent event) {
             if (!scrollInProgress) {
               //          PhonegapUtils.log("selected " + mail);
             }
           }
         });
   }
   resultsPanel.add(list);
   TouchUtils.applyFocusPatch();
   GwtUtils.deferredExecution(
       500,
       new Delegate<Void>() {
         public void execute(Void element) {
           resultsPanel.setHeight(
               "" + (Window.getClientHeight() - resultsPanel.getAbsoluteTop()) + "px");
         }
       });
 }
  public HomeViewMGwt() {
    panel = new ScrollPanel();
    container = new LayoutPanel();

    panel.add(container);

    initGui();
  }
 // workaround for chrome bug
 // see: http://code.google.com/p/mgwt/issues/detail?id=164
 public static void maybeUpdateScroller(ScrollPanel scrollPanel) {
   // no impact on production
   // this compiles out!
   if (!MGWT.getOsDetection().isDesktop()) return;
   if (isChrome) {
     scrollPanel.setUsePos(true);
   }
 }
Esempio n. 5
0
  private void initUI() {
    /*
    initHeaderBackButton("Back", new Delegate<TapEvent>() {
      public void execute(TapEvent element) {
        getPresenter().goToHome();
      }
    });
    */
    initHeaderBackButton(
        SafeHtmlUtils.fromTrustedString("<img src='main/images/home-back.png'/>"),
        new Delegate<TapEvent>() {
          public void execute(TapEvent element) {
            getPresenter().goToHome();
          }
        });
    initProvidedElements();
    initWidget(uiBinder.createAndBindUi(this));

    getScrollPanel().setScrollingEnabledX(false);
    getScrollPanel().setScrollingEnabledY(false);
    resultsPanel.setScrollingEnabledY(true);

    GwtUtils.deferredExecution(
        new Delegate<Void>() {
          public void execute(Void element) {
            int resultsHeight = Window.getClientHeight() - resultsPanel.getAbsoluteTop();
            resultsPanel.getElement().getStyle().setHeight(resultsHeight, Unit.PX);
          }
        });

    resultsPanel.addScrollMoveHandler(
        new ScrollMoveEvent.Handler() {
          public void onScrollMove(ScrollMoveEvent event) {
            scrollInProgress = true;
          }
        });
    resultsPanel.addScrollEndHandler(
        new ScrollEndEvent.Handler() {
          public void onScrollEnd(ScrollEndEvent event) {
            scrollInProgress = false;
          }
        });
  }
  public void populate(List<JobModel> modelList) {

    stopLoading();

    jobList.render(modelList);

    if (modelList != null && modelList.size() > 0) {
      noJobMessage.getElement().getStyle().setDisplay(Display.NONE);
    } else {
      noJobMessage.getElement().getStyle().setDisplay(Display.BLOCK);
    }

    scrollPanel.refresh();

    // Check if there is any unread mail, it there is, post rean notification event
    handleNotification();
  }
 @Override
 public void clear() {
   jobList.render(new ArrayList<JobModel>());
   scrollPanel.refresh();
   noJobMessage.getElement().getStyle().setDisplay(Display.NONE);
 }