mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-15 13:02:19 +00:00
introduced <f:textarea> tag for better reuse and automatic wiring.
git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@4939 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
1 parent
3a52fb088b
commit
f6334357b2
13 files changed
+48
-28
No files matched your search
@@ -27,8 +27,8 @@ import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.StringWriter;
|
||||
import java.io.PrintWriter;
|
||||
import java.io.StringWriter;
|
||||
import java.lang.management.LockInfo;
|
||||
import java.lang.management.ManagementFactory;
|
||||
import java.lang.management.MonitorInfo;
|
||||
@@ -46,6 +46,7 @@ import java.util.SortedMap;
|
||||
import java.util.TreeMap;
|
||||
import java.util.logging.LogRecord;
|
||||
import java.util.logging.SimpleFormatter;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/**
|
||||
* Utility functions used in views.
|
||||
@@ -630,4 +631,15 @@ public class Functions {
|
||||
t.printStackTrace(new PrintWriter(sw));
|
||||
return sw.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Counts the number of rows needed for textarea to fit the content.
|
||||
* Minimum 5 rows.
|
||||
*/
|
||||
public static int determineRows(String s) {
|
||||
if(s==null) return 5;
|
||||
return Math.max(5,LINE_END.split(s).length);
|
||||
}
|
||||
|
||||
private static final Pattern LINE_END = Pattern.compile("\r?\n");
|
||||
}
|
||||
Reference in new issue
Block a user