org.kde.koala

Class KStringListValidator

public class KStringListValidator extends QValidator

This validator allows you to accept only certain or to accept all but certain strings. When used in rejecting mode, accepts only strings not in the stringlist. This mode is the default and comes in handy when asking the user for a name of some listed entity. Set the list of already used names to prevent the user from entering duplicate names. When used in non-rejecting mode, accepts only strings that appear in the stringlist. Use with care! From a user's point of view this mode is hard to grasp. This validator can also fix strings. In rejecting mode, a number will be appended to the string until it is Acceptable. E.g. if "foo" and "foo 1" are in the stringlist, then fixup will change "foo" to "foo 2", provided "foo 2" isn't in the list of forbidden strings. In accepting mode, when the input starts with an Acceptable substring, truncates to the longest Acceptable string. When the input is the start of an Acceptable string, completes to the shortest Acceptable string. NOTE: fixup isn't yet implemented.

Author: Marc Mutz

UNKNOWN: A QValidator to (dis)allow certain strings.

Constructor Summary
protected KStringListValidator(Class dummy)
KStringListValidator(String[] list, boolean rejecting, boolean fixupEnabled, QObject parent, String name)
Construct a new validator.
KStringListValidator(String[] list, boolean rejecting, boolean fixupEnabled, QObject parent)
KStringListValidator(String[] list, boolean rejecting, boolean fixupEnabled)
KStringListValidator(String[] list, boolean rejecting)
KStringListValidator(String[] list)
KStringListValidator()
Method Summary
StringclassName()
voiddispose()
Delete the wrapped C++ instance ahead of finalize()
protected voidfinalize()
Deletes the wrapped C++ instance
voidfixup(StringBuffer input)
booleanisDisposed()
Has the wrapped C++ instance been deleted?
booleanisFixupEnabled()
booleanisRejecting()
QMetaObjectmetaObject()
voidsetFixupEnabled(boolean fixupEnabled)
voidsetRejecting(boolean rejecting)
voidsetStringList(String[] list)
ArrayListstringList()
intvalidate(StringBuffer input, int[] pos)

Constructor Detail

KStringListValidator

protected KStringListValidator(Class dummy)

KStringListValidator

public KStringListValidator(String[] list, boolean rejecting, boolean fixupEnabled, QObject parent, String name)
Construct a new validator.

Parameters: list The list of strings to (dis)allow. rejecting Selects the validator's mode (rejecting: true; accepting: false) fixupEnabled Selects whether to fix strings or not. parent Passed to lower level constructor. name Passed to lower level constructor

UNKNOWN: Construct a new validator.

KStringListValidator

public KStringListValidator(String[] list, boolean rejecting, boolean fixupEnabled, QObject parent)

KStringListValidator

public KStringListValidator(String[] list, boolean rejecting, boolean fixupEnabled)

KStringListValidator

public KStringListValidator(String[] list, boolean rejecting)

KStringListValidator

public KStringListValidator(String[] list)

KStringListValidator

public KStringListValidator()

Method Detail

className

public String className()

dispose

public void dispose()
Delete the wrapped C++ instance ahead of finalize()

finalize

protected void finalize()
Deletes the wrapped C++ instance

fixup

public void fixup(StringBuffer input)

isDisposed

public boolean isDisposed()
Has the wrapped C++ instance been deleted?

isFixupEnabled

public boolean isFixupEnabled()

isRejecting

public boolean isRejecting()

metaObject

public QMetaObject metaObject()

setFixupEnabled

public void setFixupEnabled(boolean fixupEnabled)

setRejecting

public void setRejecting(boolean rejecting)

setStringList

public void setStringList(String[] list)

stringList

public ArrayList stringList()

validate

public int validate(StringBuffer input, int[] pos)