示例#1
0
  public ProgressBar() {

    Grid grid = new Grid(1, 10);
    initWidget(grid);
    grid.setSize("200px", "18px");

    Image image = new Image("images/greenbox.jpg");
    image.setVisible(false);
    grid.setWidget(0, 0, image);
    image.setSize("15px", "15px");

    Image image_1 = new Image("images/greenbox.jpg");
    image_1.setVisible(false);
    grid.setWidget(0, 1, image_1);
    image_1.setSize("15px", "15px");

    Image image_2 = new Image("images/greenbox.jpg");
    image_2.setVisible(false);
    grid.setWidget(0, 2, image_2);
    image_2.setSize("15px", "15px");

    Image image_3 = new Image("images/greenbox.jpg");
    image_3.setVisible(false);
    grid.setWidget(0, 3, image_3);
    image_3.setSize("15px", "15px");

    Image image_4 = new Image("images/greenbox.jpg");
    image_4.setVisible(false);
    grid.setWidget(0, 4, image_4);
    image_4.setSize("15px", "15px");

    Image image_5 = new Image("images/greenbox.jpg");
    image_5.setVisible(false);
    grid.setWidget(0, 5, image_5);
    image_5.setSize("15px", "15px");

    Image image_6 = new Image("images/greenbox.jpg");
    image_6.setVisible(false);
    grid.setWidget(0, 6, image_6);
    image_6.setSize("15px", "15px");

    Image image_7 = new Image("images/greenbox.jpg");
    image_7.setVisible(false);
    grid.setWidget(0, 7, image_7);
    image_7.setSize("15px", "15px");

    Image image_8 = new Image("images/greenbox.jpg");
    image_8.setVisible(false);
    grid.setWidget(0, 8, image_8);
    image_8.setSize("15px", "15px");

    Image image_9 = new Image("images/greenbox.jpg");
    image_9.setVisible(false);
    grid.setWidget(0, 9, image_9);
    image_9.setSize("15px", "15px");
  }
  public StoreSchemaWidget(
      String user, HashMap<String, String> dataPublica, final SimpleSheet[] editedSheets) {
    super(true);
    setAnimationEnabled(true);
    this.setGlassEnabled(true);
    this.setPopupPosition(100, 100);
    setSize("700px", "250px");

    // now initialize the form to set author/desc

    CaptionPanel cptnpnlSubmitSchema = new CaptionPanel("Submit schema");
    cptnpnlSubmitSchema.setCaptionHTML("Submit schema");
    cptnpnlSubmitSchema.setSize("95%", "95%");

    FlowPanel flowPanel = new FlowPanel();
    cptnpnlSubmitSchema.setContentWidget(flowPanel);
    flowPanel.setSize("100%", "100%");

    Grid grid = new Grid(2, 2);
    flowPanel.add(grid);
    grid.setSize("98%", "80%");

    Label label = new Label("Schema name");
    grid.setWidget(0, 0, label);
    label.setSize("100%", "100%");

    TextBox textBox = new TextBox();
    grid.setWidget(0, 1, textBox);
    textBox.setWidth("90%");
    Label label_1 = new Label("Description");
    grid.setWidget(1, 0, label_1);
    label_1.setSize("100%", "100%");

    TextArea textArea = new TextArea();
    grid.setWidget(1, 1, textArea);
    textArea.setSize("90%", "90%");

    Button button = new Button("New button");

    final TextBox name = textBox;
    final TextArea desc = textArea;
    final String fuser = user;

    final Button fbutton = button;

    // final HashMap<String,String> data = dataPublica;

    button.addClickHandler(
        new ClickHandler() {
          public void onClick(ClickEvent event) {

            fbutton.setEnabled(false);

            final SpreadsheetParsingServiceAsync service =
                SpreadsheetParsingService.Util.getInstance();

            AsyncCallback<List<String>> callback =
                new AsyncCallback<List<String>>() {

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

                  }

                  @Override
                  public void onSuccess(List<String> attributeList) {
                    /*
                     * if(data != null) service.sendToDataPublica(data, new
                     * AsyncCallback<Void>(){
                     *
                     * @Override public void onFailure(Throwable caught) {
                     * // TODO Auto-generated method stub
                     * Window.alert("Can't send to post_url"); }
                     *
                     * @Override public void onSuccess(Void result) { //
                     * TODO Auto-generated method stub
                     * Window.open(data.get("callback_url"), "_self", ""); }
                     *
                     * });
                     */
                  }
                };
            service.storeSchema(
                name.getText(),
                "",
                fuser,
                desc.getText(),
                true,
                null,
                null,
                editedSheets,
                callback);

            setVisible(false);
          }
        });
    button.setText("Submit schema");
    flowPanel.add(button);
    button.setSize("143px", "38px");
    this.add(cptnpnlSubmitSchema);
  }
示例#3
0
  public DialogCarma(KarmaHome home, KarmaUser user) {
    super(false, true);
    this.homeParent = home;
    this.user = user;

    setHTML(CONSTANTS.this_html());

    VerticalPanel verticalPanel = new VerticalPanel();
    verticalPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
    setWidget(verticalPanel);
    verticalPanel.setWidth("100%");

    HorizontalPanel horizontalPanel = new HorizontalPanel();
    horizontalPanel.setSpacing(5);
    verticalPanel.add(horizontalPanel);
    horizontalPanel.setWidth("100%");

    VerticalPanel verticalPanel_2 = new VerticalPanel();
    horizontalPanel.add(verticalPanel_2);
    verticalPanel_2.setSize("260", "110");

    Grid grid_1 = new Grid(3, 2);
    verticalPanel_2.add(grid_1);
    grid_1.setSize("", "100");

    Label label_10 = new Label(CONSTANTS.label_10_text());
    grid_1.setWidget(0, 0, label_10);
    grid_1.getCellFormatter().setWidth(0, 0, "100");

    listTypes = new ListBox();
    grid_1.setWidget(0, 1, listTypes);
    grid_1.getCellFormatter().setWidth(0, 1, "150");
    listTypes.setWidth("100%");
    ClientUtils.fillTypes(listTypes);

    Label label_11 = new Label(CONSTANTS.label_11_text());
    grid_1.setWidget(1, 0, label_11);

    tbPlate = new TextBox();
    tbPlate.setVisibleLength(10);
    grid_1.setWidget(1, 1, tbPlate);
    tbPlate.setWidth("100%");

    cbxForeign = new CheckBox(CONSTANTS.cbxForeign_text());
    grid_1.setWidget(2, 0, cbxForeign);
    cbxForeign.addClickHandler(
        new ClickHandler() {
          public void onClick(ClickEvent event) {
            showCountries();
          }
        });

    listCountry = new ListBox();
    grid_1.setWidget(2, 1, listCountry);
    listCountry.setWidth("100%");
    listCountry.setVisible(false);
    ClientUtils.fillCountries(listCountry);

    VerticalPanel verticalPanel_6 = new VerticalPanel();
    horizontalPanel.add(verticalPanel_6);
    verticalPanel_6.setSize("260", "110");

    Grid grid_2 = new Grid(3, 2);
    verticalPanel_6.add(grid_2);
    grid_2.setSize("", "100");

    Label label_15 = new Label(CONSTANTS.label_15_text());
    grid_2.setWidget(0, 0, label_15);
    grid_2.getCellFormatter().setWidth(0, 0, "50");

    date = new DateBox();
    date.setFormat(new DefaultFormat(DateTimeFormat.getFormat("yyyy-MM-dd HH:mm")));
    grid_2.setWidget(0, 1, date);
    grid_2.getCellFormatter().setWidth(0, 1, "200");
    date.setWidth("100%");
    date.addValueChangeHandler(
        new ValueChangeHandler<Date>() {
          @Override
          public void onValueChange(ValueChangeEvent<Date> event) {
            Date d = event.getValue();
            if (d.after(new Date())
                || d.before(new Date(System.currentTimeMillis() - 31536000000L))) {
              date.setValue(new Date());
              MsgMan.getInstance().showError(CONSTANTS.error_date1(), date);
            }
          }
        });

    Label label_16 = new Label(CONSTANTS.label_16_text());
    grid_2.setWidget(1, 0, label_16);

    taNotes = new TextArea();
    taNotes.addKeyPressHandler(
        new KeyPressHandler() {
          public void onKeyPress(KeyPressEvent event) {
            updateCounter();
          }
        });
    taNotes.setSize("100%", "50");
    grid_2.setWidget(1, 1, taNotes);

    lblCounter = new Label("New label");
    lblCounter.addStyleName("counter");
    grid_2.setWidget(2, 1, lblCounter);
    grid_2.getCellFormatter().setHorizontalAlignment(2, 1, HasHorizontalAlignment.ALIGN_RIGHT);

    HorizontalPanel horizontalPanel_3 = new HorizontalPanel();
    horizontalPanel_3.setSpacing(5);
    horizontalPanel_3.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_RIGHT);
    verticalPanel.add(horizontalPanel_3);
    verticalPanel.setCellHorizontalAlignment(
        horizontalPanel_3, HasHorizontalAlignment.ALIGN_CENTER);

    btnPuntuar = new Button("New button");
    horizontalPanel_3.add(btnPuntuar);
    btnPuntuar.setText(CONSTANTS.btnPuntuar_text());
    btnPuntuar.setWidth("100");

    Button btnCancel = new Button("New button");
    horizontalPanel_3.add(btnCancel);
    btnCancel.setText(CONSTANTS.btnCancel_text());
    btnCancel.setWidth("100");
    btnPuntuar.addClickHandler(
        new ClickHandler() {
          public void onClick(ClickEvent event) {
            makeKarma();
          }
        });
    btnCancel.addClickHandler(
        new ClickHandler() {
          public void onClick(ClickEvent event) {
            DialogCarma.this.hide();
          }
        });

    updateCounter();
  }