Esempio n. 1
0
 private void clearEditor() {
   nameTextBox.setValue(null);
   descTextBox.setValue(null);
   addrTextBox.setValue(null);
   kosherCb.setValue(false);
   fancyCb.setValue(false);
   takeAwayCb.setValue(false);
   avgSelector.setValue(null);
   ratingSelector.setValue(null);
 }
 @Override
 public VariableDto getVariableDto(String script) {
   VariableDto variableDto = VariableDto.create();
   variableDto.setName(variableName.getValue());
   variableDto.setIsRepeatable(repeatableCheckbox.getValue());
   if (repeatableCheckbox.getValue()) variableDto.setOccurrenceGroup(occurrenceGroup.getValue());
   variableDto.setValueType(valueType.getValue(valueType.getSelectedIndex()));
   variableDto.setEntityType(entityType);
   variableDto.setMimeType(mimeType.getValue());
   variableDto.setUnit(unit.getValue());
   VariableDtos.setScript(variableDto, script);
   return variableDto;
 }
Esempio n. 3
0
 @Override
 public void setVocabulary(VocabularyDto vocabulary, JsArrayString locales) {
   name.setText(vocabulary.getName());
   titles.setLocaleTexts(vocabulary.getTitleArray(), JsArrays.toList(locales));
   descriptions.setLocaleTexts(vocabulary.getDescriptionArray(), JsArrays.toList(locales));
   repeatable.setValue(vocabulary.hasRepeatable() && vocabulary.getRepeatable());
 }
  private Widget checkBoxEditor(final RuleAttribute at, final boolean isReadOnly) {
    final CheckBox box = new CheckBox();
    box.setEnabled(!isReadOnly);
    if (at.getValue() == null || at.getValue().isEmpty()) {
      box.setValue(false);
      at.setValue(FALSE_VALUE);
    } else {
      box.setValue((at.getValue().equals(TRUE_VALUE)));
    }

    box.addClickHandler(
        new ClickHandler() {
          public void onClick(ClickEvent event) {
            at.setValue((box.getValue()) ? TRUE_VALUE : FALSE_VALUE);
          }
        });
    return box;
  }
Esempio n. 5
0
 @UiHandler("save")
 void onSave(ClickEvent event) {
   getUiHandlers()
       .onSave(
           name.getText(),
           repeatable.getValue(),
           titles.getLocaleTexts(),
           descriptions.getLocaleTexts());
 }
 @Override
 public void formClear() {
   variableName.setText("");
   repeatableCheckbox.setValue(false);
   occurrenceGroup.setText("");
   occurrenceGroup.setEnabled(
       false); // Occurrence group is only enabled when repeatableCheckbox is true.
   unit.setText("");
   mimeType.setText("");
 }
  @Override
  public void setNewVariable(VariableDto variableDto) {
    // Set the entity type (not displayed)
    entityType = variableDto.getEntityType();

    // Set the UI fields.
    variableName.setValue(variableDto.getName());
    setValueType(variableDto);
    repeatableCheckbox.setValue(variableDto.getIsRepeatable());
    setOccurrenceGroup(variableDto);
    setUnit(variableDto);
    setMimeType(variableDto);
  }
  @Override
  public void formEnable(boolean enabled) {
    navigationEnabled(enabled);
    saveChangesEnabled(enabled);

    variableDetailTabs.setVisible(enabled);

    variableName.setEnabled(enabled);
    removeButton.setEnabled(enabled);
    addButton.setEnabled(true); // Regardless of form state the add button is enabled.
    valueType.setEnabled(enabled);
    repeatableCheckbox.setEnabled(enabled);
    occurrenceGroup.setEnabled(enabled);
    unit.setEnabled(enabled);
    mimeType.setEnabled(enabled);
  }
 @Override
 public void addCheckBoxHandler(ClickHandler handler) {
   cbCabecalho.addClickHandler(handler);
 }
Esempio n. 10
0
 public boolean getShowAgain() {
   return !dontShowAgain.getValue();
 }
Esempio n. 11
0
 @UiHandler("closeButton")
 public void onOKButtonClick(final ClickEvent e) {
   closeCommand.execute(!dontShowAgain.getValue());
 }
Esempio n. 12
0
 public SplashModalFooter(final ParameterizedCommand<Boolean> closeCommand) {
   this.closeCommand = checkNotNull("okCommand", closeCommand);
   add(uiBinder.createAndBindUi(this));
   closeButton.ensureDebugId("SplashModalFooter-close");
   dontShowAgain.ensureDebugId("SplashModalFooter-dontShowAgain");
 }
Esempio n. 13
0
 @Override
 public HandlerRegistration addRepeatableValueChangeHandler(ValueChangeHandler<Boolean> handler) {
   return repeatableCheckbox.addValueChangeHandler(handler);
 }