Ejemplo n.º 1
0
    private ProjectWidgets(final Project project) {
      checkBox = new CheckBox();
      checkBox.addValueChangeHandler(
          new ValueChangeHandler<Boolean>() {
            @Override
            public void onValueChange(ValueChangeEvent<Boolean> event) {
              boolean isChecked = event.getValue(); // auto-unbox from Boolean to boolean
              int row = 1 + projects.indexOf(project);
              if (isChecked) {
                table.getRowFormatter().setStyleName(row, "ode-ProjectRowHighlighted");
                selectedProjects.add(project);
              } else {
                table.getRowFormatter().setStyleName(row, "ode-ProjectRowUnHighlighted");
                selectedProjects.remove(project);
              }
              Ode.getInstance().getProjectToolbar().updateButtons();
            }
          });

      nameLabel = new Label(project.getProjectName());
      nameLabel.addClickHandler(
          new ClickHandler() {
            @Override
            public void onClick(ClickEvent event) {
              Ode.getInstance().openYoungAndroidProjectInDesigner(project);
            }
          });
      nameLabel.addStyleName("ode-ProjectNameLabel");

      DateTimeFormat dateTimeFormat = DateTimeFormat.getMediumDateTimeFormat();

      Date dateCreated = new Date(project.getDateCreated());
      dateCreatedLabel = new Label(dateTimeFormat.format(dateCreated));

      Date dateModified = new Date(project.getDateModified());
      dateModifiedLabel = new Label(dateTimeFormat.format(dateModified));

      editButton = new Button("Publish");
    }
Ejemplo n.º 2
0
  /** Prepares the app publishing process */
  private void preparePublishApp(Project p, ProjectWidgets pw) {
    //    final GalleryApp app  = new GalleryApp(String title, String developerName, String
    // description,
    //        String creationDate, String updateDate, String imageURL, String sourceFileName,
    //        int downloads, int views, int likes, int comments,
    //        String imageBlobId, String sourceBlobId, String galleryAppId,
    //        ArrayList<String> tags);
    String dateCreated = String.valueOf(p.getDateCreated());
    String dateModified = String.valueOf(p.getDateModified());
    ArrayList<String> tags = new ArrayList<String>();
    tags.add("Education");
    tags.add("testing");
    final GalleryApp app1 =
        new GalleryApp(
            "Sports Analyzer",
            "Joe Hammons",
            "a great game",
            "1355091003791",
            "1355091003791",
            "http://lh3.ggpht.com/zyfGqqiN4P8GvXFVbVf-RLC--PrEDeRCu5jovFYD6l3TXYfU5pR70HXJ3yr-87p5FUGFSxeUgOMecodBOcTFYA7frUg6QTrS5ocMcNk=s100",
            "http://www.appinventor.org/apps2/ihaveadream/ihaveadream.aia",
            2,
            5,
            3,
            4,
            "",
            "",
            "",
            tags);

    pw.editButton.addClickHandler(
        new ClickHandler() {
          //  @Override
          public void onClick(ClickEvent event) {
            Ode.getInstance().switchToGalleryAppView(app1, true);
          }
        });
  }