/** {@inheritDoc} */
  @Override
  public Component doCreateWidget(Object parent) {
    if (textArea == null) {

      textArea = new TextArea();
      textArea.setSizeFull();
      textArea.addStyleName(CSS_CLASS_CONTROL);
      textArea.setImmediate(true);
      textArea.setNullRepresentation("");
      setupComponent(textArea, getCastedModel());

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

      property = new ObjectProperty<String>(null, String.class);
      textArea.setPropertyDataSource(property);

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

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

      applyCaptions();

      initializeField(textArea);
    }
    return textArea;
  }
Ejemplo n.º 2
0
  @Override
  public void valueChange(ValueChangeEvent event) {
    Object value = event.getProperty().getValue();
    if (value == null) return;
    Item theItem = propertyPairContainer.getItem(value);
    currentItem = (PropertyPairItem) theItem;
    // a clone, so a change event won't mess the table selection
    PropertyPairItem clone =
        new PropertyPairItem(currentItem.getSourceProperty(), currentItem.getTargetProperty());
    propertyToolArea.selectionChanged(clone, reviews.get((String) clone.getKey()), this);

    keyLabel.setValue(clone.getKey());
    translated.setPropertyDataSource(clone.getTarget());
    orignal.setPropertyDataSource(clone.getSource());

    translatedComment.setPropertyDataSource(clone.getTargetComment());
    orignalComment.setPropertyDataSource(clone.getSourceComment());

    applyValidation(clone.getTargetProperty());
  }