Pierre van Rooden wrote:
Nico Klasens wrote:
I understand Michiels point. It is very hard to make smart editors if the String datatype answers with undefined on the yes/no-question: do you like newlines?

It doesn't do so now either. You get a pattern and you have to then analyze it. The pattern can technically be anything.

The difference between an input-line and textarea is that you can enter \n. The pattern is the only restriction which can disallow this. You don't have to analyze the pattern. You only have to ask the pattern if it allows a \n

if (dataType.getPattern().matcher("\n").matches()) {
    // textarea
}
else {
    // input-line
}

Nico
_______________________________________________
Developers mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/developers

Reply via email to