Beispiel #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);
 }
Beispiel #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();
     }
   }
 }
Beispiel #3
0
 private boolean isTextValid() {
   return m_FieldParam.getType().isValid(this.getText());
 }