Пример #1
0
    @Override
    protected Field createField(Object propertyId, String caption) {

      if (RelatedProjectsExt.PROPERTY_CALCULATED.equals(propertyId)) {
        final CheckBox field = new CheckBox(caption);
        field.setImmediate(true);
        field.addListener(
            new ValueChangeListener() {

              private static final long serialVersionUID = 3996507266934851419L;

              @Override
              public void valueChange(com.vaadin.data.Property.ValueChangeEvent event) {
                if (comboBox != null) {
                  comboBox.setEnabled(!field.booleanValue());
                }
              }
            });
        return field;
      } else if (RelatedProjectsExt.PROPERTY_RELATED_PROJECT.equals(propertyId)) {
        UUIDList ids = extension.getRelatedProjects();
        comboBox = new MultiComboBox(caption, ids);
        comboBox.setEnabled(!extension.getCalculated());
        return comboBox;
      }
      return null;
    }
  @Override
  protected void setup() {
    FormLayout formLayout = new FormLayout();
    CheckBox control = new CheckBox("Messages On/Off");
    control.addListener(
        new ValueChangeListener() {

          @Override
          public void valueChange(ValueChangeEvent event) {
            messages.setVisible((Boolean) event.getProperty().getValue());
            messages.setRequired(true);
            messages.setCaption("Messages visible");
          }
        });
    control.setImmediate(true);
    formLayout.addComponent(control);

    messages = new TextArea("Messages hidden");
    messages.setRows(10);
    messages.setColumns(40);
    messages.setVisible(false);
    messages.setEnabled(false);
    formLayout.addComponent(messages);

    addComponent(formLayout);
  }
  /** {@inheritDoc} */
  @Override
  public Component doCreateWidget(Object parent) {
    if (checkBox == null) {

      checkBox = new CheckBox();
      checkBox.addStyleName(CSS_CLASS_CONTROL);
      checkBox.setImmediate(true);
      setupComponent(checkBox, getCastedModel());

      associateWidget(checkBox, modelAccess.yField);
      if (modelAccess.isCssIdValid()) {
        checkBox.setId(modelAccess.getCssID());
      } else {
        checkBox.setId(getEditpart().getId());
      }

      property = new ObjectProperty<Boolean>(false, Boolean.class);
      checkBox.setPropertyDataSource(property);

      // creates the binding for the field
      createBindings(modelAccess.yField, checkBox);

      if (modelAccess.isCssClassValid()) {
        checkBox.addStyleName(modelAccess.getCssClass());
      }

      applyCaptions();

      initializeField(checkBox);
    }
    return checkBox;
  }
Пример #4
0
  public SearchView(final AddressBookApplication app) {
    this.app = app;
    addStyleName("view");

    setCaption("Search contacts");
    setSizeFull();

    /* Use a FormLayout as main layout for this Panel */
    FormLayout formLayout = new FormLayout();
    setContent(formLayout);

    /* Create UI components */
    tf = new TextField("Search term");
    fieldToSearch = new NativeSelect("Field to search");
    saveSearch = new CheckBox("Save search");
    searchName = new TextField("Search name");
    Button search = new Button("Search");

    /* Initialize fieldToSearch */
    for (int i = 0; i < PersonContainer.NATURAL_COL_ORDER.length; i++) {
      fieldToSearch.addItem(PersonContainer.NATURAL_COL_ORDER[i]);
      fieldToSearch.setItemCaption(
          PersonContainer.NATURAL_COL_ORDER[i], PersonContainer.COL_HEADERS_ENGLISH[i]);
    }

    fieldToSearch.setValue("lastName");
    fieldToSearch.setNullSelectionAllowed(false);

    /* Initialize save checkbox */
    saveSearch.setValue(true);
    saveSearch.setImmediate(true);
    saveSearch.addListener(
        new ClickListener() {
          public void buttonClick(ClickEvent event) {
            searchName.setVisible(event.getButton().booleanValue());
          }
        });

    search.addListener(
        new Button.ClickListener() {
          public void buttonClick(ClickEvent event) {
            performSearch();
          }
        });

    /* Add all the created components to the form */
    addComponent(tf);
    addComponent(fieldToSearch);
    addComponent(saveSearch);
    addComponent(searchName);
    addComponent(search);
  }
Пример #5
0
  private Component toggleInvalid() {
    CheckBox invalid = new CheckBox("Invalid");
    invalid.setImmediate(true);
    invalid.addValueChangeListener(
        new ValueChangeListener() {
          @Override
          public void valueChange(ValueChangeEvent event) {
            setInvalid((Boolean) event.getProperty().getValue());
          }
        });

    return invalid;
  }
Пример #6
0
  private Component toggleIcon() {
    CheckBox iconToggle = new CheckBox();
    iconToggle.setImmediate(true);
    iconToggle.setCaption("Icons");
    iconToggle.addListener(
        new ValueChangeListener() {

          @Override
          public void valueChange(ValueChangeEvent event) {
            setIcon((Boolean) event.getProperty().getValue());
          }
        });
    return iconToggle;
  }
Пример #7
0
  private Component toggleRequired() {
    CheckBox requiredToggle = new CheckBox();
    requiredToggle.setImmediate(true);
    requiredToggle.setCaption("Required");
    requiredToggle.addListener(
        new ValueChangeListener() {

          @Override
          public void valueChange(ValueChangeEvent event) {
            setRequired((Boolean) event.getProperty().getValue());
          }
        });
    return requiredToggle;
  }
Пример #8
0
  public SpecialAccessControl() {
    setMargin(true);
    setSpacing(true);

    addComponent(userList());

    allowedBackwardInputAttendance.setCaption("Allow user to enter previous attendance.");
    allowedBackwardInputAttendance.addListener(
        new ClickListener() {

          @Override
          public void buttonClick(Button.ClickEvent event) {
            if (event.getButton().booleanValue()) {
              val = 1;
            } else {
              val = 0;
            }
          }
        });
    allowedBackwardInputAttendance.setImmediate(true);
    addComponent(allowedBackwardInputAttendance);

    Button button = new Button("UPDATE");
    button.setWidth("200px");
    button.addListener(
        new ClickListener() {

          @Override
          public void buttonClick(Button.ClickEvent event) {
            if (users.getValue() == null) {
              getWindow()
                  .showNotification("Select a User!", Window.Notification.TYPE_WARNING_MESSAGE);
              return;
            }

            boolean isUserAllowed =
                service.updateUserAllowedToEnterPreviousAttendance(
                    util.convertStringToInteger(users.getValue().toString()), isAllowed());
            if (isUserAllowed) {
              getWindow()
                  .showNotification(
                      "User is allowed to Enter Previous Attendance!",
                      Window.Notification.TYPE_TRAY_NOTIFICATION);
            }
          }
        });
    button.setImmediate(true);
    addComponent(button);
  }
Пример #9
0
  @Override
  protected void setup(VaadinRequest request) {
    final Label status = new Label("Events received: " + count);
    status.setId("count");
    addComponent(status);

    CheckBox cb = new CheckBox("Non-immediate");
    ValueChangeListener listener =
        new ValueChangeListener() {
          @Override
          public void valueChange(ValueChangeEvent event) {
            count++;
            status.setValue("Events received: " + count);
          }
        };
    cb.addValueChangeListener(listener);
    cb.setImmediate(false);
    addComponent(cb);

    cb = new CheckBox("Immediate");
    cb.addValueChangeListener(listener);
    cb.setImmediate(true);
    addComponent(cb);
  }
Пример #10
0
 @Override
 protected void setup() {
   useCustomStyles = new CheckBox("Use custom styling");
   useCustomStyles.setDebugId("styles");
   useCustomStyles.setImmediate(true);
   super.setup();
   addComponentAsFirst(useCustomStyles);
   useCustomStyles.addListener(
       new ValueChangeListener() {
         @Override
         public void valueChange(ValueChangeEvent event) {
           observations.setPlotOptions(getPlotBoxOptions());
           chart.drawChart();
         }
       });
 }
Пример #11
0
  @AutoGenerated
  private HorizontalLayout buildHorizontalLayout_1() {
    // common part: create layout
    horizontalLayout_1 = new HorizontalLayout();
    horizontalLayout_1.setImmediate(false);
    horizontalLayout_1.setWidth("-1px");
    horizontalLayout_1.setHeight("-1px");
    horizontalLayout_1.setMargin(false);
    horizontalLayout_1.setSpacing(true);

    // textAreaDescription
    textAreaDescription = new TextArea();
    textAreaDescription.setCaption("Enter A Description");
    textAreaDescription.setImmediate(false);
    textAreaDescription.setWidth("50.0%");
    textAreaDescription.setHeight("-1px");
    horizontalLayout_1.addComponent(textAreaDescription);

    // textFieldFilter
    textFieldFilter = new TextField();
    textFieldFilter.setCaption("Filter Function By ID");
    textFieldFilter.setImmediate(false);
    textFieldFilter.setWidth("-1px");
    textFieldFilter.setHeight("-1px");
    horizontalLayout_1.addComponent(textFieldFilter);
    horizontalLayout_1.setComponentAlignment(textFieldFilter, new Alignment(9));

    // comboBoxDatatypeFilter
    comboBoxDatatypeFilter = new ComboBox();
    comboBoxDatatypeFilter.setCaption("Filter By Data Type");
    comboBoxDatatypeFilter.setImmediate(false);
    comboBoxDatatypeFilter.setWidth("-1px");
    comboBoxDatatypeFilter.setHeight("-1px");
    horizontalLayout_1.addComponent(comboBoxDatatypeFilter);
    horizontalLayout_1.setComponentAlignment(comboBoxDatatypeFilter, new Alignment(9));

    // checkBoxFilterIsBag
    checkBoxFilterIsBag = new CheckBox();
    checkBoxFilterIsBag.setCaption("Is Bag Filter");
    checkBoxFilterIsBag.setImmediate(false);
    checkBoxFilterIsBag.setWidth("-1px");
    checkBoxFilterIsBag.setHeight("-1px");
    horizontalLayout_1.addComponent(checkBoxFilterIsBag);
    horizontalLayout_1.setComponentAlignment(checkBoxFilterIsBag, new Alignment(9));

    return horizontalLayout_1;
  }
  @SuppressWarnings("serial")
  @Override
  public void afterPropertiesSet() throws Exception {
    setHeight("200px");
    setWidth("700px");

    crossNameOptionGroup = new OptionGroup();
    sequenceNumCheckBox = new CheckBox();
    sequenceNumCheckBox.setImmediate(true);
    sequenceNumCheckBox.addListener(
        new Property.ValueChangeListener() {
          @Override
          public void valueChange(ValueChangeEvent event) {
            enableSpecifyLeadingZerosComponents(sequenceNumCheckBox.booleanValue());
          }
        });

    specifyPrefixLabel = new Label();
    prefixTextField = new TextField();
    prefixTextField.setWidth("500px");

    howManyDigitsLabel = new Label();
    leadingZerosSelect = new Select();
    for (int i = 1; i <= MAX_LEADING_ZEROS; i++) {
      leadingZerosSelect.addItem(Integer.valueOf(i));
    }
    leadingZerosSelect.setNullSelectionAllowed(false);
    leadingZerosSelect.select(Integer.valueOf(1));
    leadingZerosSelect.setWidth("50px");

    specifySuffixLabel = new Label();
    suffixTextField = new TextField();
    suffixTextField.setWidth("500px");

    nextNameInSequenceLabel = new Label();
    generatedNameLabel = new Label();

    generateButton = new Button();
    generateButton.setData(GENERATE_BUTTON_ID);
    generateButton.addListener(new CrossingManagerImportButtonClickListener(this));

    layoutComponents();
    initializeToggableComponents();
  }
Пример #13
0
  @AutoGenerated
  private HorizontalLayout buildHorizontalLayoutHeader() {
    // common part: create layout
    horizontalLayoutHeader = new HorizontalLayout();
    horizontalLayoutHeader.setImmediate(false);
    horizontalLayoutHeader.setWidth("100.0%");
    horizontalLayoutHeader.setHeight("-1px");
    horizontalLayoutHeader.setMargin(true);
    horizontalLayoutHeader.setSpacing(true);

    // codeField
    codeField = new TextField();
    codeField.setCaption("Código");
    codeField.setImmediate(false);
    codeField.setWidth("100px");
    codeField.setHeight("-1px");
    codeField.setRequired(true);
    horizontalLayoutHeader.addComponent(codeField);

    // nameField
    nameField = new TextField();
    nameField.setCaption("Nombre Comercial");
    nameField.setImmediate(false);
    nameField.setWidth("100.0%");
    nameField.setHeight("-1px");
    nameField.setRequired(true);
    horizontalLayoutHeader.addComponent(nameField);
    horizontalLayoutHeader.setExpandRatio(nameField, 1.0f);

    // activeField
    activeField = new CheckBox();
    activeField.setCaption("Activo");
    activeField.setImmediate(false);
    activeField.setWidth("80px");
    activeField.setHeight("-1px");
    activeField.setRequired(true);
    horizontalLayoutHeader.addComponent(activeField);
    horizontalLayoutHeader.setComponentAlignment(activeField, new Alignment(10));

    return horizontalLayoutHeader;
  }
Пример #14
0
  private void createUI(AbstractOrderedLayout layout) {
    Button b = new Button("This is a button");
    CheckBox cb = new CheckBox("This is a checkbox");
    cb.setImmediate(true);
    setTheme("tests-tickets");
    layout.setStyleName("mylayout");
    status = new Label("Result:");
    layout.addComponent(status);
    layout.setSpacing(true);
    layout.setMargin(true);

    layout.addComponent(b);
    layout.addComponent(cb);

    layout.addComponent(new Label("a"));
    layout.addComponent(new Label("b"));
    layout.addComponent(new Label("c"));

    checkButton(Button.class);
    checkCheckBox(CheckBox.class);
    checkDataBinding(CheckBox.class);
  }
Пример #15
0
 private CheckBox createSelected(final Object itemId) {
   final CheckBox c = new CheckBox();
   c.setBuffered(false);
   c.setImmediate(true);
   c.addValueChangeListener(
       new ValueChangeListener() {
         @Override
         public void valueChange(Property.ValueChangeEvent event) {
           Collection<Field<?>> fields =
               Collections2.filter(
                   getFieldsForItemId(itemId),
                   new Predicate<Field<?>>() {
                     @Override
                     public boolean apply(Field<?> eachField) {
                       return eachField != c;
                     }
                   });
           enableFields(fields, c.getValue());
         }
       });
   c.addValueChangeListener(validateOnValueChangeListener);
   return c;
 }
  private void init() {
    final Label label = new Label(i18n.get("label.auto.assign.description"));

    checkBox = new CheckBox(i18n.get("label.auto.assign.enable"));
    checkBox.setId(UIComponentIdProvider.DIST_SET_SELECT_ENABLE_ID);
    checkBox.setImmediate(true);
    checkBox.addValueChangeListener(this);

    final VerticalLayout verticalLayout = new VerticalLayout();
    verticalLayout.addComponent(label);
    verticalLayout.addComponent(checkBox);
    verticalLayout.addComponent(dsTable);

    window =
        new WindowBuilder(SPUIDefinitions.CREATE_UPDATE_WINDOW)
            .caption(i18n.get("caption.select.auto.assign.dist"))
            .content(verticalLayout)
            .layout(verticalLayout)
            .i18n(i18n)
            .saveDialogCloseListener(this)
            .buildCommonDialogWindow();
    window.setId(UIComponentIdProvider.DIST_SET_SELECT_WINDOW_ID);
  }
Пример #17
0
  @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;
  }
Пример #18
0
  protected Component createMainArea() {
    layout = new VerticalLayout();

    layout.setSpacing(true);
    layout.setMargin(true);
    layout.setSizeFull();

    HorizontalLayout filterLine = new HorizontalLayout();

    TextField filterBox = new TextField();
    filterBox.addStyleName(JabylonStyle.SEARCH_FIELD.getCSSName());
    filterBox.addListener(
        new TextChangeListener() {

          @Override
          public void textChange(TextChangeEvent event) {
            propertyFilter.setFilterText(event.getText());
            propertyPairContainer.addContainerFilter(propertyFilter);
          }
        });
    filterBox.setInputPrompt(
        Messages.getString("PropertiesEditor_FILTER_INPUT_PROMPT")); // $NON-NLS-1$
    filterLine.addComponent(filterBox);

    final CheckBox untranslatedBox =
        new CheckBox(
            Messages.getString(
                "PropertiesEditor_SHOW_ONLY_UNTRANSLATED_BUTTON_CAPTION")); //$NON-NLS-1$
    untranslatedBox.addListener(
        new ClickListener() {

          @Override
          public void buttonClick(ClickEvent event) {
            propertyPairContainer.removeContainerFilter(untranslatedFilter);
            if (untranslatedBox.getValue().equals(Boolean.TRUE))
              propertyPairContainer.addContainerFilter(untranslatedFilter);
          }
        });
    untranslatedBox.setImmediate(true);
    filterLine.addComponent(untranslatedBox);

    layout.addComponent(filterLine);
    layout.setExpandRatio(filterLine, 0);

    table = new Table();
    table.addStyleName(JabylonStyle.TABLE_STRIPED.getCSSName());
    table.setSizeFull();
    target = descriptor.loadProperties();
    source = descriptor.getMaster().loadProperties();

    propertyPairContainer = new PropertyPairContainer(source, target);
    table.setContainerDataSource(propertyPairContainer);
    table.setVisibleColumns(
        propertyPairContainer.getContainerPropertyIds().subList(0, 2).toArray());
    table.setWidth(100, Table.UNITS_PERCENTAGE);
    table.addGeneratedColumn(
        Messages.getString("PropertiesEditor_PROBLEMS_COLUMN_HEADER"),
        new ColumnGenerator() { //$NON-NLS-1$

          @Override
          public Object generateCell(Table source, Object itemId, Object columnId) {

            if (reviews.containsKey(itemId)) {
              Embedded embedded = new Embedded("", ImageConstants.IMAGE_ERROR); // $NON-NLS-1$

              Review review = reviews.get((String) itemId).iterator().next();
              // TODO: this can't be the right way to refresh?
              if (review.cdoInvalid()) {
                reviews.remove(itemId, review); // the review is
                // no
                // longer valid
                embedded.setIcon(ImageConstants.IMAGE_OK);
                embedded.setDescription(""); // $NON-NLS-1$
              } else {
                embedded.setDescription(review.getMessage());
              }

              return embedded;
            } else return new Embedded("", ImageConstants.IMAGE_OK); // $NON-NLS-1$
          }
        });

    table.setColumnHeaderMode(Table.COLUMN_HEADER_MODE_EXPLICIT);

    table.setColumnHeaders(
        new String[] {
          Messages.getString("PropertiesEditor_ORIGINAL_COLUMN_HEADER"),
          Messages.getString("PropertiesEditor_TRANSLATED_COLUMN_HEADER"),
          Messages.getString("PropertiesEditor_PROBLEMS_COLUMN_HEADER")
        }); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
    table.setColumnExpandRatio(propertyPairContainer.getContainerPropertyIds().get(0), 1.0f);
    table.setColumnExpandRatio(propertyPairContainer.getContainerPropertyIds().get(1), 1.0f);
    table.setColumnExpandRatio(
        Messages.getString("PropertiesEditor_PROBLEMS_COLUMN_HEADER"), 0.0f); // $NON-NLS-1$

    table.setEditable(false);
    table.setWriteThrough(false);

    table.setSelectable(true);
    table.setMultiSelect(false);
    table.setImmediate(true); // react at once when something is selected
    table.addListener(this);

    layout.addComponent(table);

    layout.setExpandRatio(table, 2);
    createEditorArea();
    return layout;
  }
Пример #19
0
  // Build the UI components
  private void buildview() {
    logger.info(
        "Company ID : "
            + companyid
            + " | User Name : "
            + username
            + " > "
            + "Painting Email logger UI");
    btnAdd.setVisible(false);
    btnDownload.setVisible(false);
    btnEdit.setVisible(false);
    btnAuditRecords.setVisible(false);
    // Email-id text box
    tfemailid = new TextField("Email Id");
    // product combo box
    cbproduct = new GERPComboBox("Product Name");
    cbproduct.setItemCaptionPropertyId("prodname");
    loadProductList();
    // Email start date
    dfemailStartdate = new GERPPopupDateField("Log Start Dt");
    dfemailStartdate.setInputPrompt("Select Date");
    // Email End date
    dfemailEndDate = new GERPPopupDateField("Log End Dt");
    dfemailEndDate.setInputPrompt("Select Date");
    btndelete = new Button("Delete");
    btndelete.addStyleName("delete");
    btndelete.setEnabled(true);
    btndelete.setVisible(true);
    btndelete.addClickListener(
        new ClickListener() {
          private static final long serialVersionUID = 1L;

          @Override
          public void buttonClick(ClickEvent event) {
            btndelete.setEnabled(true);
            if (cockeckall.getValue().equals(true)) {
              for (EmailLoggerDM obj : emailList) {
                serviceemailLogger.delete(obj.getEmaillogId());
              }

            } else {
              delete();
            }

            loadSrchRslt();
            /*	btndelete.setEnabled(false);
            cockeckall.setValue(false);*/
          }
        });
    cockeckall = new CheckBox("Select All");
    cockeckall.addStyleName("delete");
    cockeckall.setEnabled(true);
    cockeckall.setVisible(true);
    setCheckBoxTable();
    cockeckall.setImmediate(true);
    cockeckall.addValueChangeListener(
        new Property.ValueChangeListener() {
          private static final long serialVersionUID = 1L;

          public void valueChange(ValueChangeEvent event) {
            if (event.getProperty().getValue().equals(true)) {
              loadSrchRslt();
              btndelete.setEnabled(true);
            } else {
              loadSrchRslt();
              btndelete.setEnabled(false);
            }
          }
        });
    hlCmdBtnLayout.addComponent(cockeckall);
    hlCmdBtnLayout.setSpacing(true);
    hlCmdBtnLayout.setComponentAlignment(cockeckall, Alignment.MIDDLE_RIGHT);
    hlCmdBtnLayout.addComponent(btndelete);
    hlCmdBtnLayout.setComponentAlignment(btndelete, Alignment.MIDDLE_RIGHT);
    hlCmdBtnLayout.setExpandRatio(btndelete, 1);
    // build search layout
    hlSearchLayout = new GERPAddEditHLayout();
    assembleSearchLayout();
    hlSrchContainer.addComponent(GERPPanelGenerator.createPanel(hlSearchLayout));
    resetFields();
    loadSrchRslt();
  }
Пример #20
0
  @Override
  public void init() {
    setMainWindow(main);
    setTheme("reindeer");

    themeToggle = new CheckBox("Runo theme");
    themeToggle.addListener(
        new ValueChangeListener() {

          @Override
          public void valueChange(ValueChangeEvent event) {
            if (getTheme() == "reindeer") {
              setTheme("runo");
            } else {
              setTheme("reindeer");
            }
          }
        });
    themeToggle.setStyleName("small");
    themeToggle.setImmediate(true);

    styleToggle = new CheckBox("Black style");
    styleToggle.addListener(
        new ValueChangeListener() {

          @Override
          public void valueChange(ValueChangeEvent event) {
            if (!main.getContent().getStyleName().contains("black")) {
              main.getContent().setStyleName("black");
            } else {
              main.getContent().setStyleName("");
            }
          }
        });
    styleToggle.setImmediate(true);
    styleToggle.setStyleName("small");

    iconToggle = new CheckBox("64x icons");
    iconToggle.addListener(
        new ValueChangeListener() {

          @Override
          public void valueChange(ValueChangeEvent event) {
            largeIcons = !largeIcons;
            recreateAll();
          }
        });
    iconToggle.setImmediate(true);
    iconToggle.setStyleName("small");

    nativeToggle = new CheckBox("Native buttons");
    nativeToggle.addListener(
        new ValueChangeListener() {

          @Override
          public void valueChange(ValueChangeEvent event) {
            nativeButtons = !nativeButtons;
            recreateAll();
          }
        });
    nativeToggle.setImmediate(true);
    nativeToggle.setStyleName("small");

    toggles.setSpacing(true);
    toggles.addComponent(themeToggle);
    toggles.addComponent(styleToggle);
    toggles.addComponent(iconToggle);
    toggles.addComponent(nativeToggle);
    main.addComponent(toggles);

    recreateAll();
  }
Пример #21
0
  @AutoGenerated
  private AbsoluteLayout buildMainLayout() {
    // common part: create layout
    mainLayout = new AbsoluteLayout();
    mainLayout.setImmediate(false);
    mainLayout.setWidth("580px");
    mainLayout.setHeight("360px");
    mainLayout.setMargin(true);

    // top-level component properties
    setWidth("580px");
    setHeight("360px");

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

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

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

    // packageNameField
    packageNameField = new TextField();
    packageNameField.setCaption("Paquete");
    packageNameField.setImmediate(false);
    packageNameField.setWidth("400px");
    packageNameField.setHeight("-1px");
    packageNameField.setRequired(true);
    mainLayout.addComponent(packageNameField, "top:64.0px;left:20.0px;");

    // versionField
    versionField = new TextField();
    versionField.setCaption("Versión");
    versionField.setImmediate(false);
    versionField.setWidth("120px");
    versionField.setHeight("-1px");
    versionField.setRequired(true);
    mainLayout.addComponent(versionField, "top:64.0px;left:440.0px;");

    // activeField
    activeField = new CheckBox();
    activeField.setCaption("Activo");
    activeField.setImmediate(false);
    activeField.setWidth("-1px");
    activeField.setHeight("-1px");
    activeField.setRequired(true);
    mainLayout.addComponent(activeField, "top:20.0px;left:507.0px;");

    // fileField
    fileField = new FileField();
    fileField.setImmediate(false);
    fileField.setWidth("540px");
    fileField.setHeight("-1px");
    mainLayout.addComponent(fileField, "top:160.0px;left:20.0px;");

    // errorMessageField
    errorMessageField = new TextArea();
    errorMessageField.setCaption("Mensaje Error");
    errorMessageField.setImmediate(false);
    errorMessageField.setWidth("540px");
    errorMessageField.setHeight("120px");
    mainLayout.addComponent(errorMessageField, "top:220.0px;left:20.0px;");

    return mainLayout;
  }
Пример #22
0
  /**
   * The constructor should first build the main layout, set the composition root and then do any
   * custom initialization.
   *
   * <p>The constructor will not be automatically regenerated by the visual editor.
   *
   * @throws Exception
   * @throws IllegalArgumentException
   */
  public JobViewForm() throws IllegalArgumentException, Exception {
    buildMainLayout();
    setCompositionRoot(mainLayout);

    // TODO add user code here
    initComponents();

    cronExpressionField.setVisible(false);
    future_timeField.setEnabled(false);
    startTimeField.setResolution(DateField.RESOLUTION_SEC);
    endTimeField.setResolution(DateField.RESOLUTION_SEC);

    // configure Type data
    areaField.setItemCaptionMode(Select.ITEM_CAPTION_MODE_PROPERTY);
    areaField.setItemCaptionPropertyId("name");

    jobTriggerTypeField.setItemCaptionMode(Select.ITEM_CAPTION_MODE_PROPERTY);
    jobTriggerTypeField.setItemCaptionPropertyId("description");

    jobIntervalTypeField.setItemCaptionMode(Select.ITEM_CAPTION_MODE_PROPERTY);
    jobIntervalTypeField.setItemCaptionPropertyId("description");

    // get form services from OSGi Service Registry
    getServices();

    // load data sources
    loadData();

    futureField.setImmediate(true);
    futureField.addListener(
        new ValueChangeListener() {
          @Override
          public void valueChange(ValueChangeEvent event) {
            if (event.getProperty().getValue() == null) return;

            if ((Boolean) event.getProperty().getValue()) future_timeField.setEnabled(true);
            else {
              future_timeField.setValue(null);
              future_timeField.setEnabled(false);
            }
          }
        });

    jobTriggerTypeField.setImmediate(true);
    jobTriggerTypeField.setNullSelectionAllowed(false);
    jobTriggerTypeField.addListener(
        new ValueChangeListener() {
          @Override
          public void valueChange(ValueChangeEvent event) {
            if (event.getProperty().getValue() == null) return;

            if (((JobTriggerType) event.getProperty().getValue())
                .getCode()
                .equals(Job.JOB_TRIGGER_TYPE.SIMPLE.name())) {
              jobIntervalField.setVisible(true);
              jobIntervalTypeField.setVisible(true);
              repeatCountField.setVisible(true);
              cronExpressionField.setVisible(false);
            } else {
              jobIntervalField.setVisible(false);
              jobIntervalTypeField.setVisible(false);
              repeatCountField.setVisible(false);
              cronExpressionField.setVisible(true);
            }
          }
        });
  }
Пример #23
0
  private void buildWorkSpace() {
    mainLayout.addTab(workSpace, "Work Space");
    workSpace.setSizeFull();

    final TextField className = new TextField("Correlator Class Name");
    final TextArea classCode = new TextArea("Correlator Code");

    final TextField builderClassName = new TextField("Builder Class Name");
    final TextArea builderClassCode = new TextArea("Builder Code");

    final CheckBox withBuilder = new CheckBox("Correlator comes with builder?");
    withBuilder.setImmediate(true);
    withBuilder.addListener(
        new Property.ValueChangeListener() {
          public void valueChange(Property.ValueChangeEvent event) {
            if (withBuilder.booleanValue()) {
              builderClassName.setVisible(true);
              builderClassCode.setVisible(true);
            } else {
              builderClassName.setVisible(false);
              builderClassCode.setVisible(false);
            }
          }
        });

    final Button compile = new Button("Add Correlator");
    compile.addListener(
        new Button.ClickListener() {
          public void buttonClick(Button.ClickEvent event) {

            if (!withBuilder.booleanValue()) {
              CorrelatorFromCodeFactory.createCorrelator(
                  (String) helper.getBean("classPath"),
                  className.getValue().toString(),
                  classCode.getValue().toString(),
                  correlatorBuilderManager,
                  feed,
                  correlatorPool,
                  null,
                  null,
                  null);
            } else {
              RuntimeJavaFileCompiler.compile(
                  (String) helper.getBean("classPath"),
                  className.getValue().toString(),
                  classCode.getValue().toString());
              CorrelatorBuilderFromCodeFactory.createCorrelatorBuilder(
                  (String) helper.getBean("classPath"),
                  builderClassName.getValue().toString(),
                  builderClassCode.getValue().toString(),
                  correlatorBuilderManager,
                  feed,
                  correlatorPool);
            }
          }
        });

    workSpace.addComponent(className);
    workSpace.addComponent(classCode);
    workSpace.addComponent(withBuilder);
    workSpace.addComponent(builderClassName);
    workSpace.addComponent(builderClassCode);
    builderClassName.setVisible(false);
    builderClassCode.setVisible(false);
    workSpace.addComponent(compile);

    classCode.setWidth("100%");
    classCode.setHeight("500px");
    builderClassCode.setWidth("100%");
    builderClassCode.setHeight("500px");
  }