FileDocCategorySizeDatePackage
PortFieldEditor.javaAPI DocAndroid 1.5 API2084Wed May 06 22:41:08 BST 2009com.android.ddmuilib

PortFieldEditor

public class PortFieldEditor extends org.eclipse.jface.preference.IntegerFieldEditor
Edit an integer field, validating it as a port number.

Fields Summary
public boolean
mRecursiveCheck
Constructors Summary
public PortFieldEditor(String name, String label, org.eclipse.swt.widgets.Composite parent)


           
        super(name, label, parent);
        setValidateStrategy(VALIDATE_ON_KEY_STROKE);
    
Methods Summary
protected booleancheckState()

        if (super.checkState() == false) {
            return false;
        }
        //Log.i("ddms", "check state " + getStringValue());
        boolean err = false;
        int val = getCurrentValue();
        if (val < 1024 || val > 32767) {
            setErrorMessage("Port must be between 1024 and 32767");
            err = true;
        } else {
            setErrorMessage(null);
            err = false;
        }
        showErrorMessage();
        return !err;
    
public intgetCurrentValue()

        int val;
        try {
            val = Integer.parseInt(getStringValue());
        }
        catch (NumberFormatException nfe) {
            val = -1;
        }
        return val;
    
protected voidupdateCheckState(com.android.ddmuilib.PortFieldEditor pfe)

        pfe.refreshValidState();