@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);
  }
    @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;
    }
  /** Is called when the new value should be saved after the save button has been clicked */
  @Override
  public void saveOrUpdate() {
    if (checkBox.getValue() && dsTable.getValue() != null) {
      final DistributionSetIdName ds = (DistributionSetIdName) dsTable.getValue();
      updateTargetFilterQueryDS(tfqId, ds.getId());

    } else if (!checkBox.getValue()) {
      updateTargetFilterQueryDS(tfqId, null);
    }
  }
  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);
  }
 @Override
 public void selectionValueChanged(SelectionValueChangedEvent selectionValueChangedEvent) {
   if (selectionValueChangedEvent.getBean() == getParentData()) {
     for (Object eachRowId : getItemIds()) {
       CheckBox checkBox = getCheckBoxForRow(eachRowId);
       updateCheckBox(checkBox, eachRowId, selectionValueChangedEvent.getNewValue());
       checkBox.setEnabled(
           selectionValueChangedEvent
               .getNewValue()); // we have to check/uncheck the checkbox according to the parent's
                                // selection
     }
   }
 }
Exemple #6
0
  private void checkCheckBox(Class<? extends CheckBox> class1) {
    boolean ok = false;
    CheckBox b;
    try {
      b = class1.newInstance();
    } catch (Exception e1) {
      e1.printStackTrace();
      return;
    }

    b.setCaption("Button of type " + class1.getSimpleName());
    status.setValue(status.getValue() + " " + class1.getClass().getSimpleName() + ": OK");
  }
  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;
  }
 private void desligaCampos() {
   titulo.setReadOnly(true);
   nome.setReadOnly(true);
   email.setReadOnly(true);
   telefone.setReadOnly(true);
   cargo.setReadOnly(true);
   login.setReadOnly(true);
   senha1.setReadOnly(true);
   senha2.setReadOnly(true);
   admin.setReadOnly(true);
   // users.setEnabled(true);
   bloquear.setReadOnly(true);
 }
  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;
  }
  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;
  }
  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);
  }
 /**
  * Is triggered when the checkbox value changes
  *
  * @param event change event
  */
 @Override
 public void valueChange(final Property.ValueChangeEvent event) {
   dsTable.setVisible(checkBox.getValue());
   if (window != null) {
     window.center();
   }
 }
  @Override
  protected void updateLabels() {
    fileField.setCaption(
        getI18N()
            .getMessage(
                "com.thingtrack.konekti.view.web.form.KnowledgeViewForm.fileField.caption"));
    activeField.setCaption(
        getI18N()
            .getMessage(
                "com.thingtrack.konekti.view.web.form.KnowledgeViewForm.activeField.caption"));
    versionField.setCaption(
        getI18N()
            .getMessage(
                "com.thingtrack.konekti.view.web.form.KnowledgeViewForm.versionField.caption"));
    packageNameField.setCaption(
        getI18N()
            .getMessage(
                "com.thingtrack.konekti.view.web.form.KnowledgeViewForm.packageNameField.caption"));
    nameField.setCaption(
        getI18N()
            .getMessage(
                "com.thingtrack.konekti.view.web.form.KnowledgeViewForm.nameField.caption"));
    idField.setCaption(
        getI18N()
            .getMessage("com.thingtrack.konekti.view.web.form.KnowledgeViewForm.idField.caption"));
    descriptionField.setCaption(
        getI18N()
            .getMessage(
                "com.thingtrack.konekti.view.web.form.KnowledgeViewForm.descriptionField.caption"));

    errorMessageField.setReadOnly(true);
  }
  public void initComponentState() {
    fieldAmount.setVisible(false);
    fieldAmountafterppn.setVisible(false);

    fieldDisc1rp.setVisible(false);
    //		fieldDisc1rpafterppn.setVisible(false);
    fieldDisc.setVisible(false);

    fieldDisc2.setVisible(false);
    fieldDisc2rp.setVisible(false);
    fieldDisc2rpafterppn.setVisible(false);

    fieldDiscrp.setVisible(false);
    //		fieldDiscrpafterppn.setVisible(false);

    fieldPpnpercent.setVisible(false);

    fieldAmountpay.setVisible(false);
    fieldAmountpayfaterppn.setVisible(false);

    checkSaldo.setVisible(false);

    fieldDisc.setVisible(false);

    fieldAmount.setVisible(false);
    fieldPpnrp.setVisible(false);
    fieldAmountafterdisc.setVisible(false);
    fieldAmountafterdiscafterppn.setVisible(false);

    //		btnLapselisih.setVisible(false);
  }
Exemple #15
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();
         }
       });
 }
  private void updateCalendarLocale(Locale l) {
    int oldFirstDayOfWeek = calendar.getFirstDayOfWeek();
    setLocale(l);
    calendarComponent.setLocale(l);
    calendar = new GregorianCalendar(l);
    int newFirstDayOfWeek = calendar.getFirstDayOfWeek();

    // we are showing 1 week, and the first day of the week has changed
    // update start and end dates so that the same week is showing
    if (viewMode == Mode.WEEK && oldFirstDayOfWeek != newFirstDayOfWeek) {
      calendar.setTime(calendarComponent.getStartDate());
      calendar.add(java.util.Calendar.DAY_OF_WEEK, 2);
      // starting at the beginning of the week
      calendar.set(GregorianCalendar.DAY_OF_WEEK, newFirstDayOfWeek);
      Date start = calendar.getTime();

      // ending at the end of the week
      calendar.add(GregorianCalendar.DATE, 6);
      Date end = calendar.getTime();

      calendarComponent.setStartDate(start);
      calendarComponent.setEndDate(end);

      // Week days depend on locale so this must be refreshed
      setWeekendsHidden(hideWeekendsButton.getValue());
    }
  }
 @Override
 protected void writeToConfig() {
   int maxGiB = myTranscodingCacheMaxGiB.getIntegerValue(1);
   MyTunesRss.CONFIG.setTranscodingCacheMaxGiB(maxGiB);
   MyTunesRss.TRANSCODER_CACHE.setMaxSizeBytes((long) maxGiB * 1024L * 1024L * 1024L);
   maxGiB = myHttpLiveStreamCacheMaxGiB.getIntegerValue(5);
   MyTunesRss.CONFIG.setHttpLiveStreamCacheMaxGiB(maxGiB);
   MyTunesRss.HTTP_LIVE_STREAMING_CACHE.setMaxSizeBytes((long) maxGiB * 1024L * 1024L * 1024L);
   String vlcBinary = myVlcBinary.getStringValue(null);
   File vlcExecutable = vlcBinary != null ? new File(vlcBinary) : null;
   if (vlcExecutable != null
       && vlcExecutable.isDirectory()
       && SystemUtils.IS_OS_MAC_OSX
       && "vlc.app".equalsIgnoreCase(vlcExecutable.getName())) {
     vlcExecutable = new File(vlcExecutable, "Contents/MacOS/VLC");
   }
   MyTunesRss.CONFIG.setVlcExecutable(vlcExecutable);
   MyTunesRss.CONFIG.setVlcEnabled(myVlcEnabled.booleanValue());
   Set<TranscoderConfig> deletedTranscoders = new HashSet<>();
   for (TranscoderConfig transcoderConfig : MyTunesRss.CONFIG.getTranscoderConfigs()) {
     deletedTranscoders.add(transcoderConfig);
   }
   for (TranscoderConfig transcoderConfig : myTranscoderConfigs) {
     deletedTranscoders.remove(transcoderConfig);
   }
   for (TranscoderConfig deletedTranscoder : deletedTranscoders) {
     LOGGER.debug(
         "Transcoder config \""
             + deletedTranscoder.getName()
             + "\" has been removed, truncating cache.");
     MyTunesRss.TRANSCODER_CACHE.deleteByPrefix(deletedTranscoder.getCacheFilePrefix());
   }
   MyTunesRss.CONFIG.setTranscoderConfigs(myTranscoderConfigs);
   MyTunesRss.CONFIG.save();
 }
  @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;
  }
  /**
   * Fills the form with current field component. Adds additional widgets if needed (i.e. "select
   * all" box)
   *
   * @param form The form to place the field in
   * @param layout The layout that displays the field
   */
  public void placeYourselfInForm(Form form, FormLayout layout) {
    if (fieldComponent == null) {
      return;
    }

    if (fieldComponent instanceof Field) {
      form.addField(name, (Field) fieldComponent);
    } else if (fieldComponent instanceof FilterContainer) {
      for (Select select : ((FilterContainer) fieldComponent).getLevels()) {
        form.addField(select.getCaption(), select);
      }
    } else {
      layout.addComponent(fieldComponent);
    }

    if (selectAll) {
      final CheckBox saCheckbox = UiFactory.createCheckBox(UiIds.AR_MSG_SELECT_ALL, null);
      saCheckbox.addListener(
          new Property.ValueChangeListener() {
            @Override
            public void valueChange(ValueChangeEvent event) {
              boolean selected = (Boolean) saCheckbox.getValue();
              if (fieldComponent instanceof Select) {
                for (Object itemId : ((Select) fieldComponent).getItemIds()) {
                  if (selected) {
                    ((Select) fieldComponent).select(itemId);
                  } else {
                    ((Select) fieldComponent).unselect(itemId);
                  }
                }
              }
              if (fieldComponent instanceof FilterContainer) {
                List<Select> selectList = ((FilterContainer) fieldComponent).getLevels();
                Select select = selectList.get(selectList.size() - 1);
                for (Object itemId : select.getItemIds()) {
                  if (selected) {
                    select.select(itemId);
                  } else {
                    select.unselect(itemId);
                  }
                }
              }
            }
          });
      form.addField(name + "_all", saCheckbox);
    }
  }
Exemple #20
0
  protected Object addTaskRow(
      Object previousTaskItemId,
      String taskName,
      String taskAssignee,
      String taskGroups,
      String taskDescription,
      Boolean startWithPrevious) {

    Object newItemId = null;
    if (previousTaskItemId == null) { // add at the end of list
      newItemId = addItem();
    } else {
      newItemId = addItemAfter(previousTaskItemId);
    }
    Item newItem = getItem(newItemId);

    // name
    newItem.getItemProperty(ID_NAME).setValue(taskName == null ? "my task" : taskName);

    // assignee
    newItem.getItemProperty(ID_ASSIGNEE).setValue(taskAssignee == null ? "" : taskAssignee);

    // groups
    newItem.getItemProperty(ID_GROUPS).setValue(taskGroups == null ? "" : taskGroups);

    // description
    TextField descriptionTextField = new TextField();
    descriptionTextField.setColumns(16);
    descriptionTextField.setRows(1);
    if (taskDescription != null) {
      descriptionTextField.setValue(taskDescription);
    }
    newItem.getItemProperty(ID_DESCRIPTION).setValue(descriptionTextField);

    // concurrency
    CheckBox startWithPreviousCheckBox =
        new CheckBox(i18nManager.getMessage(Messages.PROCESS_EDITOR_TASK_START_WITH_PREVIOUS));
    startWithPreviousCheckBox.setValue(startWithPrevious == null ? false : startWithPrevious);
    newItem.getItemProperty(ID_START_WITH_PREVIOUS).setValue(startWithPreviousCheckBox);

    // actions
    newItem.getItemProperty(ID_ACTIONS).setValue(generateActionButtons(newItemId));

    return newItemId;
  }
Exemple #21
0
  public boolean onBack() {
    boolean allowed = allowBack.booleanValue();
    if (!allowed) {
      Notification.show("Not allowed, sorry");

      layout.addComponent(new Label("Not allowed, sorry"));
    }
    return allowed;
  }
  /*
   * (non-Javadoc)
   *
   * @see com.vaadin.tests.components.AbstractTestUI#setup(com.vaadin.server.
   * VaadinRequest)
   */
  @Override
  protected void setup(VaadinRequest request) {
    final Button btn = new Button();
    btn.setId("button");
    btn.setIcon(ICON, "initial alt text");
    addComponent(btn);

    final CheckBox enable = new CheckBox("Enable alt text", true);
    enable.addValueChangeListener(
        event -> {
          if (event.getValue()) {
            btn.setIconAlternateText("alt text");
          } else {
            btn.setIconAlternateText("");
          }
        });
    addComponent(enable);
  }
  @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();
  }
  private void initFormFields(Layout formLayout, Class<? extends CalendarEvent> eventClass) {

    startDateField = createDateField("Start date");
    endDateField = createDateField("End date");

    final CheckBox allDayField = createCheckBox("All-day");
    allDayField.addValueChangeListener(
        event -> {
          if (event.getValue()) {
            setFormDateResolution(Resolution.DAY);
          } else {
            setFormDateResolution(Resolution.MINUTE);
          }
        });

    captionField = createTextField("Caption");
    final TextField whereField = createTextField("Where");
    final TextArea descriptionField = createTextArea("Description");
    descriptionField.setRows(3);

    final ComboBox styleNameField = createStyleNameComboBox();

    formLayout.addComponent(startDateField);
    formLayout.addComponent(endDateField);
    formLayout.addComponent(allDayField);
    formLayout.addComponent(captionField);
    if (eventClass == CalendarTestEvent.class) {
      formLayout.addComponent(whereField);
    }
    formLayout.addComponent(descriptionField);
    formLayout.addComponent(styleNameField);

    scheduleEventFieldGroup.bind(startDateField, "start");
    scheduleEventFieldGroup.bind(endDateField, "end");
    scheduleEventFieldGroup.bind(captionField, "caption");
    scheduleEventFieldGroup.bind(descriptionField, "description");
    if (eventClass == CalendarTestEvent.class) {
      scheduleEventFieldGroup.bind(whereField, "where");
    }
    scheduleEventFieldGroup.bind(styleNameField, "styleName");
    scheduledEventBinder.bind(allDayField, CalendarEvent::isAllDay, null);
  }
 @Override
 protected void writeToConfig() {
   MyTunesRss.CONFIG.setWebLoginMessage(myWebLoginMessage.getStringValue(null));
   MyTunesRss.CONFIG.setWebWelcomeMessage(myWebWelcomeMessage.getStringValue(null));
   MyTunesRss.CONFIG.setServerBrowserActive(myServerBrowserActive.booleanValue());
   MyTunesRss.CONFIG.setOpenIdActive(myOpenIdActive.booleanValue());
   MyTunesRss.CONFIG.setProxyHost(myProxyHost.getStringValue(null));
   MyTunesRss.CONFIG.setProxyPort(myProxyPort.getIntegerValue(-1));
   MyTunesRss.CONFIG.setMailHost(myMailHost.getStringValue(null));
   MyTunesRss.CONFIG.setMailPort(myMailPort.getIntegerValue(-1));
   MyTunesRss.CONFIG.setSmtpProtocol((SmtpProtocol) mySmtpProtocol.getValue());
   MyTunesRss.CONFIG.setMailLogin(myMailLogin.getStringValue(null));
   MyTunesRss.CONFIG.setMailPassword(myMailPassword.getStringValue(null));
   MyTunesRss.CONFIG.setMailSender(myMailSender.getStringValue(null));
   MyTunesRss.CONFIG.setHeadless(myHeadless.booleanValue());
   String gmBinary = myGraphicsMagickBinary.getStringValue(null);
   MyTunesRss.CONFIG.setGmExecutable(gmBinary != null ? new File(gmBinary) : null);
   MyTunesRss.CONFIG.setGmEnabled(myGraphicsMagickEnabled.booleanValue());
   MyTunesRss.CONFIG.save();
 }
  @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;
  }
 private void limpaCampos() {
   ligaCampos();
   nome.setValue("");
   email.setValue("");
   telefone.setValue("");
   cargo.setValue("");
   login.setValue("");
   senha1.setValue("");
   senha2.setValue("");
   admin.setValue(false);
   desligaCampos();
 }
  /** {@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;
  }
  @Override
  protected void initFromConfig() {

    myWebLoginMessage.setValue(MyTunesRss.CONFIG.getWebLoginMessage());
    myWebWelcomeMessage.setValue(MyTunesRss.CONFIG.getWebWelcomeMessage());
    myServerBrowserActive.setValue(MyTunesRss.CONFIG.isServerBrowserActive());
    myOpenIdActive.setValue(MyTunesRss.CONFIG.isOpenIdActive());
    myProxyHost.setValue(MyTunesRss.CONFIG.getProxyHost());
    myProxyPort.setValue(MyTunesRss.CONFIG.getProxyPort(), 1, 65535, "");
    myMailHost.setValue(MyTunesRss.CONFIG.getMailHost());
    myMailPort.setValue(MyTunesRss.CONFIG.getMailPort(), 1, 65535, "");
    mySmtpProtocol.setValue(MyTunesRss.CONFIG.getSmtpProtocol());
    myMailLogin.setValue(MyTunesRss.CONFIG.getMailLogin());
    myMailPassword.setValue(MyTunesRss.CONFIG.getMailPassword());
    myMailSender.setValue(MyTunesRss.CONFIG.getMailSender());
    myHeadless.setValue(MyTunesRss.CONFIG.isHeadless());
    myGraphicsMagickEnabled.setValue(MyTunesRss.CONFIG.isGmEnabled());
    myGraphicsMagickBinary.setValue(
        MyTunesRss.CONFIG.getGmExecutable() != null
            ? MyTunesRss.CONFIG.getGmExecutable().getAbsolutePath()
            : "");
  }
Exemple #30
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);
  }