Пример #1
0
 // 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);
   }
 }
Пример #2
0
 private void updateTotals() {
   if (MGWT.getFormFactor().isDesktop()) {
     txtBudget.setValue(getAmountFormat().format(project.budgeted().getTotal()));
     txtActual.setValue(getAmountFormat().format(project.actual().getTotal()));
     txtPaid.setValue(getAmountFormat().format(project.paid().getTotal()));
     txtBalance.setValue(getAmountFormat().format(project.balance().getTotal()));
     txtPercent.setValue(getPercentFormat().format(project.percent()));
   }
 }
  public CalloutViewGwtImpl() {

    pullToRefresh = new PullPanel();
    pullArrowHeader = new PullArrowHeader();
    pullToRefresh.setHeader(pullArrowHeader);

    initWidget(uiBinder.createAndBindUi(this));

    if (MGWT.getOsDetection().isAndroid()) {
      leftFlexSpacer.setVisible(false);
    }
  }
Пример #4
0
 private void initGrids() {
   projectItemGrid = new EzeeProjectItemGrid(this);
   projectItems.add(projectItemGrid);
   projectItemDetailGrid = new EzeeProjectItemDetailGrid(this);
   projectItemDetails.add(projectItemDetailGrid);
   projectItemGrid.addListener(projectItemDetailGrid);
   projectPaymentGrid = new EzeeProjectPaymentGrid(this);
   projectPayments.add(projectPaymentGrid);
   projectItemGrid.addListener(projectPaymentGrid);
   if (!MGWT.getFormFactor().isDesktop()) {
     hideTotals();
   } else {
     updateTotals();
   }
 }
 public ProjectListViewImpl() {
   initWidget(uiBinder.createAndBindUi(this));
   this.back.setVisible(!MGWT.getOsDetection().isAndroid());
 }
  public FerriesRouteDeparturesViewGwtImpl() {

    pullToRefresh = new PullPanel();
    pullArrowHeader = new PullArrowHeader();
    pullToRefresh.setHeader(pullArrowHeader);

    daysOfWeek = new MListBox();

    handleOnLoad();

    cellList =
        new CellList<FerriesScheduleTimesItem>(
            new FerriesRouteDeparturesCell<FerriesScheduleTimesItem>() {

              @Override
              public String getDeparting(FerriesScheduleTimesItem model) {
                Date departingTime = new Date(Long.parseLong(model.getDepartingTime()));

                return dateFormat.format(departingTime, usPacific);
              }

              @Override
              public String getArriving(FerriesScheduleTimesItem model) {
                if (!model.getArrivingTime().equals("N/A")) {
                  Date arrivingTime = new Date(Long.parseLong(model.getArrivingTime()));

                  return dateFormat.format(arrivingTime, usPacific);
                } else {
                  return "";
                }
              }

              @Override
              public SafeHtml getAnnotation(FerriesScheduleTimesItem model) {
                if (model.getAnnotations() != null) {
                  return SafeHtmlUtils.fromTrustedString(model.getAnnotations());
                } else {
                  return SafeHtmlUtils.fromString("");
                }
              }

              @Override
              public boolean canBeSelected(FerriesScheduleTimesItem model) {
                return false;
              }

              @Override
              public String getDriveUpSpaces(FerriesScheduleTimesItem model) {
                return String.valueOf(model.getDriveUpSpaceCount());
              }

              @Override
              public String getMaxSpaceCount(FerriesScheduleTimesItem model) {
                return String.valueOf(model.getMaxSpaceCount());
              }

              @Override
              public String getLastUpdated(FerriesScheduleTimesItem model) {
                if (model.getLastUpdated() != null) {
                  return ParserUtils.relativeTime(
                      model.getLastUpdated(), "MMMM d, yyyy h:mm a", false);
                } else {
                  return "";
                }
              }
            });

    cameraCellList =
        new CellList<CameraItem>(
            new CameraCell<CameraItem>() {

              @Override
              public String getUrl(CameraItem model) {
                return model.getImageUrl();
              }

              @Override
              public boolean canBeSelected(CameraItem model) {
                return true;
              }
            });

    initWidget(uiBinder.createAndBindUi(this));

    accessibilityPrepare();

    if (MGWT.getOsDetection().isAndroid()) {
      leftFlexSpacer.setVisible(false);
      cameraScrollPanel.setBounce(false);
    }
  }