示例#1
0
 public StringFieldEditor(FieldParameter fieldParam) {
   super();
   m_FieldParam = fieldParam;
   m_Value = m_FieldParam.getType();
   this.setText(m_Value.asString());
   m_Valid = m_FieldParam.isValid(m_Value);
   this.getDocument().addDocumentListener(this);
   this.setToolTipText(m_Value.getTooltip());
   this.setColumns(NUM_COLS);
   this.setHorizontalAlignment(JTextField.LEFT);
 }
示例#2
0
 private void textChanged() {
   if (isTextValid()) {
     boolean newState = m_Valid;
     try {
       m_Value = m_FieldParam.getType().parseString(this.getText());
       newState = m_FieldParam.isValid(m_Value);
     } catch (Exception e) {
       newState = false;
       ErrorHandler.getInstance().handleException(e, Activator.getBundle());
     }
     if (newState != m_Valid) {
       m_Valid = newState;
       this.notifyListeners();
     }
   }
 }
示例#3
0
 private boolean isTextValid() {
   return m_FieldParam.getType().isValid(this.getText());
 }