private FramedPanel panelMain() {

    FramedPanel panel = new FramedPanel();
    panel.setHeadingText("Monitoring Lunas QA 1");
    panel.setBodyStyle("background: none; padding: 5px");
    panel.setWidth(650);

    // panel Title="Pilih Referensi"

    VerticalLayoutContainer p = new VerticalLayoutContainer();
    panel.add(p);

    ComboUnits cbUnit = new ComboUnits();
    p.add(cbUnit);

    DateField dfTopTanggalAwal = new DateField();
    p.add(new FieldLabel(dfTopTanggalAwal, "Tanggal Awal"));

    DateField dfTopTanggalAkhir = new DateField();
    p.add(new FieldLabel(dfTopTanggalAkhir, "Tanggal Akhir"));

    p.add(new TextButton("Filter"));

    // panel "Data CN"

    IconDynamicGrid GdMonitoringLunasQA1 = new IconDynamicGrid();
    GdMonitoringLunasQA1.setGridHeader("Data Lunas QA 1");
    GdMonitoringLunasQA1.setGridDimension(620, 200);
    GdMonitoringLunasQA1.setStoreUrl("BasicProject/thuGetString.json?name=store1");

    GdMonitoringLunasQA1.addColumn("BOOL", 100);

    p.add(GdMonitoringLunasQA1);

    return panel;
  }
Exemple #2
0
  public Widget getWidget() {
    form2 = new FramedPanel();
    form2.setHeadingText("");
    form2.setWidth("100%");

    FieldSet fieldSet = new FieldSet();
    fieldSet.setHeadingText("Emailing Setting");
    fieldSet.setCollapsible(true);
    fieldSet.setHeight(155);
    form2.add(fieldSet);

    VerticalLayoutContainer p = new VerticalLayoutContainer();
    fieldSet.add(p);
    HorizontalPanel hp = new HorizontalPanel();
    //	    statusButton.setValue(true);
    //	    final TextButton refreshButton = new TextButton();
    //	    refreshButton.setIcon(ressources.loading());
    //	    statusButton.setWidth("60px");
    hp.add(statusButton);
    //	    hp.add(refreshButton);
    p.add(new FieldLabel(hp, "System status"));

    month.setTriggerAction(TriggerAction.ALL);
    month.setEditable(false);
    month.setWidth(100);
    month.add(lFrequency);

    month.addSelectionHandler(
        new SelectionHandler<String>() {

          @Override
          public void onSelection(SelectionEvent<String> event) {}
        });
    p.add(new FieldLabel(month, "Frequency"), new VerticalLayoutData(1, -1));
    date.addParseErrorHandler(
        new ParseErrorHandler() {

          @Override
          public void onParseError(ParseErrorEvent event) {
            Info.display("Parse Error", event.getErrorValue() + " could not be parsed as a date");
          }
        });

    date.addValueChangeHandler(
        new ValueChangeHandler<Date>() {

          @Override
          public void onValueChange(ValueChangeEvent<Date> event) {
            String v =
                event.getValue() == null
                    ? "nothing"
                    : DateTimeFormat.getFormat(PredefinedFormat.DATE_MEDIUM)
                        .format(event.getValue());
          }
        });
    //	    date.addValidator(new MinDateValidator(new Date()));
    p.add(new FieldLabel(date, "Starting date"), new VerticalLayoutData(1, -1));

    time.addParseErrorHandler(
        new ParseErrorHandler() {

          @Override
          public void onParseError(ParseErrorEvent event) {}
        });

    time.setMinValue(new DateWrapper().clearTime().addHours(8).asDate());
    time.setMaxValue(new DateWrapper().clearTime().addHours(18).addSeconds(1).asDate());
    p.add(new FieldLabel(time, "Starting time"), new VerticalLayoutData(1, -1));

    statusButton.addValueChangeHandler(
        new ValueChangeHandler<Boolean>() {

          @Override
          public void onValueChange(ValueChangeEvent<Boolean> event) {
            statusButton.setText(statusButton.getValue() ? "On" : "Off");
          }
        });
    load();
    form2.addButton(refresh);
    form2.addButton(save);
    refresh.addSelectHandler(
        new SelectHandler() {

          @Override
          public void onSelect(SelectEvent event) {
            refresh.setIcon(ressources.loading());
            refresh.setEnabled(false);
            load();
          }
        });
    save.addSelectHandler(
        new SelectHandler() {

          @Override
          public void onSelect(SelectEvent event) {
            save.setIcon(ressources.loading());
            save.setEnabled(false);
            save();
          }
        });
    return form2;
  }