コード例 #1
0
  @Override
  public void setValue(Object value) {
    if (value == null || NO_INSTANCE.equals(value)) {
      getComponent().setText("");
      m_value = value;
      return;
    }

    //	The same
    if (value.equals(m_value)) return;
    //	new value
    log.fine("Value=" + value);
    m_value = value;
    getComponent().setText(m_mPAttribute.getDisplay(value)); // 	loads value
  }
コード例 #2
0
 public void onEvent(Event event) {
   if (Events.ON_CHANGE.equals(event.getName()) || Events.ON_OK.equals(event.getName())) {
     String newText = getComponent().getText();
     String oldText = null;
     if (m_value != null) {
       oldText = m_mPAttribute.getDisplay(m_value);
     }
     if (oldText != null && newText != null && oldText.equals(newText)) {
       return;
     }
     if (oldText == null && newText == null) {
       return;
     }
     ValueChangeEvent changeEvent =
         new ValueChangeEvent(this, this.getColumnName(), oldText, newText);
     fireValueChange(changeEvent);
   } else if (Events.ON_CLICK.equals(event.getName())) {
     cmd_dialog();
   }
 }