code: public void updateButtonVisibility() {
          if (isDirty()) {
              if (m_isValid) {
                  m_saveButton.setEnabled(true);
              }
              m_undoButton.setEnabled(true);
              if (m_td != null) {
                  m_td.setDirty(m_itemId, true);
              }
              m_owner.indicateDirtiness();
          } else {
              m_saveButton.setEnabled(false);
              m_undoButton.setEnabled(false);
              if (m_td != null) {
                  m_td.setDirty(m_itemId, false);
              }
              m_owner.indicateDirtiness();
          }
          if (!m_isValid) {
              m_saveButton.setEnabled(false);
          }
      }
docs: Disables save and undo buttons if any changes have occurred, enables them
  otherwise. This is called whenever dataChangeListener recieves an event,
  and should be called manually at the end of save() and undo().