コード例 #1
0
ファイル: JobViewForm.java プロジェクト: coderhelps/konekti
  @Override
  protected void updateLabels() {
    jobNameField.setCaption(
        getI18N()
            .getMessage("com.thingtrack.konekti.view.web.form.JobViewForm.jobNameField.caption"));
    jobGroupField.setCaption(
        getI18N()
            .getMessage("com.thingtrack.konekti.view.web.form.JobViewForm.jobGroupField.caption"));
    startTimeField.setCaption(
        getI18N()
            .getMessage("com.thingtrack.konekti.view.web.form.JobViewForm.startTimeField.caption"));
    endTimeField.setCaption(
        getI18N()
            .getMessage("com.thingtrack.konekti.view.web.form.JobViewForm.endTimeField.caption"));
    areaField.setCaption(
        getI18N().getMessage("com.thingtrack.konekti.view.web.form.JobViewForm.areaField.caption"));
    descriptionField.setCaption(
        getI18N()
            .getMessage(
                "com.thingtrack.konekti.view.web.form.JobViewForm.descriptionField.caption"));
    jobTriggerTypeField.setCaption(
        getI18N()
            .getMessage(
                "com.thingtrack.konekti.view.web.form.JobViewForm.jobTriggerTypeField.caption"));
    jobTriggerPriorityField.setCaption(
        getI18N()
            .getMessage(
                "com.thingtrack.konekti.view.web.form.JobViewForm.jobTriggerPriorityField.caption"));
    future_timeField.setCaption(
        getI18N()
            .getMessage(
                "com.thingtrack.konekti.view.web.form.JobViewForm.future_timeField.caption"));
    futureField.setCaption(
        getI18N()
            .getMessage("com.thingtrack.konekti.view.web.form.JobViewForm.futureField.caption"));
    jobIntervalField.setCaption(
        getI18N()
            .getMessage(
                "com.thingtrack.konekti.view.web.form.JobViewForm.jobIntervalField.caption"));
    repeatCountField.setCaption(
        getI18N()
            .getMessage(
                "com.thingtrack.konekti.view.web.form.JobViewForm.repeatCountField.caption"));
    // jobCalendarField.setCaption(getI18N().getMessage("com.thingtrack.konekti.view.web.form.JobViewForm.jobCalendarField.caption"));

  }
コード例 #2
0
  public void init(String title, Class<T> typeOfRows, String objectCode) {
    setModal(true);
    setClosable(true);
    setResizable(false);
    setDraggable(false);
    setHeight("90%");
    setWidth("100%");
    setCaption("<b>" + title + "</b>");
    setCaptionAsHtml(true);

    this.objectCode = objectCode;

    dfFrom = new DateField();
    dfFrom.setCaption("Từ Ngày");
    dfFrom.addStyleName("date-field-caption");
    dfTo = new DateField();
    dfTo.setCaption("Đến Ngày");
    dfTo.addStyleName("date-field-caption");
    btnOk = new Button("Xem Báo Cáo");
    btnOk.addStyleName(ValoTheme.BUTTON_SMALL);
    btnOk.addStyleName(ValoTheme.BUTTON_FRIENDLY);
    btnOk.addStyleName("margin-top-2px");

    gridSummaryReportDetail = new MGrid<ReportDetailSummary>(ReportDetailSummary.class);
    gridSummaryReportDetail.setWidth("50%");
    gridSummaryReportDetail.setHeight("77px");
    gridSummaryReportDetail.setEditorEnabled(false);
    gridSummaryReportDetail.setSelectionMode(SelectionMode.NONE);
    gridSummaryReportDetail.withProperties(
        "openingStock", "issueInPeriod", "receiptInPeriod", "closingStock");

    gridContent = new MGrid<>(typeOfRows);

    VerticalLayout wrapper = new VerticalLayout();
    wrapper.setSpacing(true);

    // Add first line
    HorizontalLayout hrzDateFields = new HorizontalLayout();
    wrapper.addComponent(hrzDateFields);
    wrapper.setComponentAlignment(hrzDateFields, Alignment.TOP_CENTER);
    hrzDateFields.addComponent(dfFrom);
    hrzDateFields.addComponent(dfTo);
    hrzDateFields.addComponent(btnOk);
    hrzDateFields.addStyleName("margin-left-right-20px df-report-detail-style");

    // Add second line
    wrapper.addComponent(gridSummaryReportDetail);
    wrapper.setComponentAlignment(gridSummaryReportDetail, Alignment.TOP_CENTER);

    wrapper.addComponent(gridContent);
    gridContent.setWidth("100%");
    gridContent.setHeight("10%");
    gridContent.setEditorEnabled(false);
    gridContent.setSelectionMode(SelectionMode.NONE);

    gridContentProperties = new ArrayList<String>();

    withTableProperties(getProperties());
    withHeaderNames(getHeaderNames());
    setContent(wrapper);

    btnOk.addClickListener(
        new ClickListener() {
          private static final long serialVersionUID = -2918006939436642296L;

          @Override
          public void buttonClick(ClickEvent event) {
            if (!objectCode.isEmpty()) {
              generateSummaryReportDetails(dfFrom.getValue(), dfTo.getValue());
              generateReportDetails(dfFrom.getValue(), dfTo.getValue());
            }
          }
        });
  }
コード例 #3
0
ファイル: JobViewForm.java プロジェクト: coderhelps/konekti
  @AutoGenerated
  private AbsoluteLayout buildMainLayout() {
    // common part: create layout
    mainLayout = new AbsoluteLayout();
    mainLayout.setImmediate(false);
    mainLayout.setWidth("650px");
    mainLayout.setHeight("220px");
    mainLayout.setMargin(true);

    // top-level component properties
    setWidth("650px");
    setHeight("220px");

    // jobGroupField
    jobGroupField = new TextField();
    jobGroupField.setCaption("Grupo");
    jobGroupField.setImmediate(false);
    jobGroupField.setWidth("140px");
    jobGroupField.setHeight("-1px");
    jobGroupField.setRequired(true);
    mainLayout.addComponent(jobGroupField, "top:20.0px;left:180.0px;");

    // jobIntervalField
    jobIntervalField = new TextField();
    jobIntervalField.setCaption("Intervalo");
    jobIntervalField.setImmediate(false);
    jobIntervalField.setWidth("60px");
    jobIntervalField.setHeight("-1px");
    mainLayout.addComponent(jobIntervalField, "top:180.0px;left:20.0px;");

    // jobNameField
    jobNameField = new TextField();
    jobNameField.setCaption("Nombre");
    jobNameField.setImmediate(false);
    jobNameField.setWidth("140px");
    jobNameField.setHeight("-1px");
    jobNameField.setRequired(true);
    mainLayout.addComponent(jobNameField, "top:20.0px;left:20.0px;");

    // jobTriggerPriorityField
    jobTriggerPriorityField = new TextField();
    jobTriggerPriorityField.setCaption("Job Trigger Priority");
    jobTriggerPriorityField.setImmediate(false);
    jobTriggerPriorityField.setWidth("160px");
    jobTriggerPriorityField.setHeight("-1px");
    mainLayout.addComponent(jobTriggerPriorityField, "top:140.0px;left:200.0px;");

    // jobTriggerTypeField
    jobTriggerTypeField = new ComboBox();
    jobTriggerTypeField.setCaption("Tipo Disparador");
    jobTriggerTypeField.setImmediate(true);
    jobTriggerTypeField.setWidth("160px");
    jobTriggerTypeField.setHeight("-1px");
    jobTriggerTypeField.setRequired(true);
    mainLayout.addComponent(jobTriggerTypeField, "top:140.0px;left:20.0px;");

    // cronExpressionField
    cronExpressionField = new TextField();
    cronExpressionField.setCaption("Expresión Cron ");
    cronExpressionField.setImmediate(false);
    cronExpressionField.setWidth("340px");
    cronExpressionField.setHeight("-1px");
    mainLayout.addComponent(cronExpressionField, "top:180.0px;left:20.0px;");

    // descriptionField
    descriptionField = new TextField();
    descriptionField.setCaption("Descripción");
    descriptionField.setImmediate(false);
    descriptionField.setWidth("620px");
    descriptionField.setHeight("-1px");
    mainLayout.addComponent(descriptionField, "top:100.0px;left:20.0px;");

    // endTimeField
    endTimeField = new DateField();
    endTimeField.setCaption("Fecha Finalización");
    endTimeField.setImmediate(false);
    endTimeField.setWidth("-1px");
    endTimeField.setHeight("-1px");
    endTimeField.setInvalidAllowed(false);
    mainLayout.addComponent(endTimeField, "top:60.0px;left:225.0px;");

    // futureField
    futureField = new CheckBox();
    futureField.setCaption("Futuro");
    futureField.setImmediate(false);
    futureField.setWidth("-1px");
    futureField.setHeight("-1px");
    mainLayout.addComponent(futureField, "top:140.0px;left:585.0px;");

    // future_timeField
    future_timeField = new TextField();
    future_timeField.setCaption("Future_time");
    future_timeField.setImmediate(false);
    future_timeField.setWidth("160px");
    future_timeField.setHeight("-1px");
    mainLayout.addComponent(future_timeField, "top:140.0px;left:400.0px;");

    // repeatCountField
    repeatCountField = new TextField();
    repeatCountField.setCaption("Repeticiones");
    repeatCountField.setImmediate(false);
    repeatCountField.setWidth("60px");
    repeatCountField.setHeight("24px");
    mainLayout.addComponent(repeatCountField, "top:180.0px;right:290.0px;");

    // startTimeField
    startTimeField = new DateField();
    startTimeField.setCaption("Fecha Comienzo");
    startTimeField.setImmediate(false);
    startTimeField.setWidth("-1px");
    startTimeField.setHeight("-1px");
    startTimeField.setInvalidAllowed(false);
    mainLayout.addComponent(startTimeField, "top:60.0px;left:20.0px;");

    // areaField
    areaField = new ComboBox();
    areaField.setCaption("Area Trabajo");
    areaField.setImmediate(false);
    areaField.setWidth("-1px");
    areaField.setHeight("-1px");
    areaField.setRequired(true);
    mainLayout.addComponent(areaField, "top:60.0px;left:420.0px;");

    // jobCalendarField
    jobCalendarField = new JobTriggerCalendarField();
    jobCalendarField.setImmediate(false);
    jobCalendarField.setWidth("-1px");
    jobCalendarField.setHeight("-1px");
    mainLayout.addComponent(jobCalendarField, "top:167.0px;left:397.0px;");

    // jobIntervalTypeField
    jobIntervalTypeField = new ComboBox();
    jobIntervalTypeField.setCaption("Tipo Intervalo");
    jobIntervalTypeField.setImmediate(false);
    jobIntervalTypeField.setWidth("175px");
    jobIntervalTypeField.setHeight("-1px");
    mainLayout.addComponent(jobIntervalTypeField, "top:180.0px;left:100.0px;");

    return mainLayout;
  }