EGF Engine
Release 0.1.0

org.eclipse.egf.pattern.ui.editor.page
Class AbstractPatternPage.TextValidator

java.lang.Object
  extended by org.eclipse.egf.pattern.ui.editor.page.AbstractPatternPage.TextValidator
Direct Known Subclasses:
PatternImplementationPage.MethodNameValidator, PatternSpecificationPage.ParameterNameValidator
Enclosing class:
AbstractPatternPage

protected abstract class AbstractPatternPage.TextValidator
extends Object

Textual control validation class.


Field Summary
protected static String ERROR_KEY_REG_EXP
          ERROR KEY : text does not match given regular expression.
 
Constructor Summary
protected AbstractPatternPage.TextValidator(Control textControl_p)
          Constructor.
 
Method Summary
protected  void addErrorKey(String errorKey_p)
          Add new error key.
protected  Control getControl()
          Get control.
protected abstract  String getErrorMessageFor(String errorKey_p, String value_p)
          Get error message for given error key and erroneous value.
 void handleValueChange(ValueChangeEvent event_p)
           
protected  boolean onError(String text_p)
          On error condition for current textual value.
protected  void setRegularExpression(String regularExpression_p)
          Set regular expression.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ERROR_KEY_REG_EXP

protected static final String ERROR_KEY_REG_EXP
ERROR KEY : text does not match given regular expression.

See Also:
Constant Field Values
Constructor Detail

AbstractPatternPage.TextValidator

protected AbstractPatternPage.TextValidator(Control textControl_p)
Constructor.

Parameters:
textControl_p -
Method Detail

getControl

protected Control getControl()
Get control.

Returns:

handleValueChange

public void handleValueChange(ValueChangeEvent event_p)
See Also:
org.eclipse.core.databinding.observable.value.IValueChangeListener#handleValueChange(org.eclipse.core.databinding.observable.value.ValueChangeEvent)

setRegularExpression

protected void setRegularExpression(String regularExpression_p)
Set regular expression.

Parameters:
regularExpression_p -

addErrorKey

protected void addErrorKey(String errorKey_p)
Add new error key.

Parameters:
errorKey_p -

onError

protected boolean onError(String text_p)
On error condition for current textual value.
Default implementation is testing the new value against set regular expression.
If no regular expression has been set, always returns true.

Parameters:
text_p - the new textual value.
Returns:
true if on error, false otherwise.

getErrorMessageFor

protected abstract String getErrorMessageFor(String errorKey_p,
                                             String value_p)
Get error message for given error key and erroneous value.

Parameters:
errorKey_p -
value_p -
Returns:

EGF Engine
Release 0.1.0

Copyright (c) Thales Corporate Services S.A.S, 2009.

This page is made available under license. For full details see the LEGAL in the documentation book that contains this page.