| <!DOCTYPE HTML> |
| <!-- NewPage --> |
| <html lang="en"> |
| <head> |
| <!-- Generated by javadoc --> |
| <title>Preferences (Apache JSPWiki 2.12.2-SNAPSHOT API)</title> |
| <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
| <link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style"> |
| <link rel="stylesheet" type="text/css" href="../../../../jquery/jquery-ui.css" title="Style"> |
| <script type="text/javascript" src="../../../../script.js"></script> |
| <script type="text/javascript" src="../../../../jquery/jszip/dist/jszip.min.js"></script> |
| <script type="text/javascript" src="../../../../jquery/jszip-utils/dist/jszip-utils.min.js"></script> |
| <!--[if IE]> |
| <script type="text/javascript" src="../../../../jquery/jszip-utils/dist/jszip-utils-ie.min.js"></script> |
| <![endif]--> |
| <script type="text/javascript" src="../../../../jquery/jquery-3.5.1.js"></script> |
| <script type="text/javascript" src="../../../../jquery/jquery-ui.js"></script> |
| </head> |
| <body> |
| <script type="text/javascript"><!-- |
| try { |
| if (location.href.indexOf('is-external=true') == -1) { |
| parent.document.title="Preferences (Apache JSPWiki 2.12.2-SNAPSHOT API)"; |
| } |
| } |
| catch(err) { |
| } |
| //--> |
| var data = {"i0":9,"i1":9,"i2":9,"i3":9,"i4":9,"i5":9,"i6":9,"i7":9}; |
| var tabs = {65535:["t0","All Methods"],1:["t1","Static Methods"],8:["t4","Concrete Methods"]}; |
| var altColor = "altColor"; |
| var rowColor = "rowColor"; |
| var tableTab = "tableTab"; |
| var activeTableTab = "activeTableTab"; |
| var pathtoroot = "../../../../"; |
| var useModuleDirectories = true; |
| loadScripts(document, 'script');</script> |
| <noscript> |
| <div>JavaScript is disabled on your browser.</div> |
| </noscript> |
| <header role="banner"> |
| <nav role="navigation"> |
| <div class="fixedNav"> |
| <!-- ========= START OF TOP NAVBAR ======= --> |
| <div class="topNav"><a id="navbar.top"> |
| <!-- --> |
| </a> |
| <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> |
| <a id="navbar.top.firstrow"> |
| <!-- --> |
| </a> |
| <ul class="navList" title="Navigation"> |
| <li><a href="../../../../index.html">Overview</a></li> |
| <li><a href="package-summary.html">Package</a></li> |
| <li class="navBarCell1Rev">Class</li> |
| <li><a href="class-use/Preferences.html">Use</a></li> |
| <li><a href="package-tree.html">Tree</a></li> |
| <li><a href="../../../../deprecated-list.html">Deprecated</a></li> |
| <li><a href="../../../../index-all.html">Index</a></li> |
| <li><a href="../../../../help-doc.html">Help</a></li> |
| </ul> |
| </div> |
| <div class="subNav"> |
| <ul class="navList" id="allclasses_navbar_top"> |
| <li><a href="../../../../allclasses.html">All Classes</a></li> |
| </ul> |
| <ul class="navListSearch"> |
| <li><label for="search">SEARCH:</label> |
| <input type="text" id="search" value="search" disabled="disabled"> |
| <input type="reset" id="reset" value="reset" disabled="disabled"> |
| </li> |
| </ul> |
| <div> |
| <script type="text/javascript"><!-- |
| allClassesLink = document.getElementById("allclasses_navbar_top"); |
| if(window==top) { |
| allClassesLink.style.display = "block"; |
| } |
| else { |
| allClassesLink.style.display = "none"; |
| } |
| //--> |
| </script> |
| <noscript> |
| <div>JavaScript is disabled on your browser.</div> |
| </noscript> |
| </div> |
| <div> |
| <ul class="subNavList"> |
| <li>Summary: </li> |
| <li><a href="#nested.class.summary">Nested</a> | </li> |
| <li><a href="#field.summary">Field</a> | </li> |
| <li><a href="#constructor.summary">Constr</a> | </li> |
| <li><a href="#method.summary">Method</a></li> |
| </ul> |
| <ul class="subNavList"> |
| <li>Detail: </li> |
| <li><a href="#field.detail">Field</a> | </li> |
| <li><a href="#constructor.detail">Constr</a> | </li> |
| <li><a href="#method.detail">Method</a></li> |
| </ul> |
| </div> |
| <a id="skip.navbar.top"> |
| <!-- --> |
| </a></div> |
| <!-- ========= END OF TOP NAVBAR ========= --> |
| </div> |
| <div class="navPadding"> </div> |
| <script type="text/javascript"><!-- |
| $('.navPadding').css('padding-top', $('.fixedNav').css("height")); |
| //--> |
| </script> |
| </nav> |
| </header> |
| <!-- ======== START OF CLASS DATA ======== --> |
| <main role="main"> |
| <div class="header"> |
| <div class="subTitle"><span class="packageLabelInType">Package</span> <a href="package-summary.html">org.apache.wiki.preferences</a></div> |
| <h2 title="Class Preferences" class="title">Class Preferences</h2> |
| </div> |
| <div class="contentContainer"> |
| <ul class="inheritance"> |
| <li>java.lang.Object</li> |
| <li> |
| <ul class="inheritance"> |
| <li>java.util.AbstractMap<K,​V></li> |
| <li> |
| <ul class="inheritance"> |
| <li>java.util.HashMap<java.lang.String,​java.lang.String></li> |
| <li> |
| <ul class="inheritance"> |
| <li>org.apache.wiki.preferences.Preferences</li> |
| </ul> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| <div class="description"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <dl> |
| <dt>All Implemented Interfaces:</dt> |
| <dd><code>java.io.Serializable</code>, <code>java.lang.Cloneable</code>, <code>java.util.Map<java.lang.String,​java.lang.String></code></dd> |
| </dl> |
| <hr> |
| <object type="image/svg+xml" data="Preferences.svg" style="max-width:60%;float:right;"></object> |
| <pre style="white-space:pre-wrap;">public class <a href="../../../../src-html/org/apache/wiki/preferences/Preferences.html#line.50">Preferences</a> |
| extends java.util.HashMap<java.lang.String,​java.lang.String></pre> |
| <div class="block">Represents an object which is used to store user preferences.</div> |
| <dl> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="../../../../serialized-form.html#org.apache.wiki.preferences.Preferences">Serialized Form</a></dd> |
| </dl> |
| </li> |
| </ul> |
| </div> |
| <div class="summary" style="clear:right;"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <!-- ======== NESTED CLASS SUMMARY ======== --> |
| <section role="region"> |
| <ul class="blockList"> |
| <li class="blockList"><a id="nested.class.summary"> |
| <!-- --> |
| </a> |
| <h3>Nested Class Summary</h3> |
| <table class="memberSummary"> |
| <caption><span>Nested Classes</span><span class="tabEnd"> </span></caption> |
| <tr> |
| <th class="colFirst" scope="col">Modifier and Type</th> |
| <th class="colSecond" scope="col">Class</th> |
| <th class="colLast" scope="col">Description</th> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>static class </code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="Preferences.TimeFormat.html" title="enum in org.apache.wiki.preferences">Preferences.TimeFormat</a></span></code></th> |
| <td class="colLast"> |
| <div class="block">Is used to choose between the different date formats that JSPWiki supports.</div> |
| </td> |
| </tr> |
| </table> |
| <ul class="blockList"> |
| <li class="blockList"><a id="nested.classes.inherited.from.class.java.util.AbstractMap"> |
| <!-- --> |
| </a> |
| <h3>Nested classes/interfaces inherited from class java.util.AbstractMap</h3> |
| <code>java.util.AbstractMap.SimpleEntry<K extends java.lang.Object,​V extends java.lang.Object>, java.util.AbstractMap.SimpleImmutableEntry<K extends java.lang.Object,​V extends java.lang.Object></code></li> |
| </ul> |
| <ul class="blockList"> |
| <li class="blockList"><a id="nested.classes.inherited.from.class.java.util.Map"> |
| <!-- --> |
| </a> |
| <h3>Nested classes/interfaces inherited from interface java.util.Map</h3> |
| <code>java.util.Map.Entry<K extends java.lang.Object,​V extends java.lang.Object></code></li> |
| </ul> |
| </li> |
| </ul> |
| </section> |
| <!-- =========== FIELD SUMMARY =========== --> |
| <section role="region"> |
| <ul class="blockList"> |
| <li class="blockList"><a id="field.summary"> |
| <!-- --> |
| </a> |
| <h3>Field Summary</h3> |
| <table class="memberSummary"> |
| <caption><span>Fields</span><span class="tabEnd"> </span></caption> |
| <tr> |
| <th class="colFirst" scope="col">Modifier and Type</th> |
| <th class="colSecond" scope="col">Field</th> |
| <th class="colLast" scope="col">Description</th> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>static java.lang.String</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#COOKIE_USER_PREFS_NAME">COOKIE_USER_PREFS_NAME</a></span></code></th> |
| <td class="colLast"> </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code>static java.lang.String</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#SESSIONPREFS">SESSIONPREFS</a></span></code></th> |
| <td class="colLast"> |
| <div class="block">The name under which a Preferences object is stored in the HttpSession.</div> |
| </td> |
| </tr> |
| </table> |
| </li> |
| </ul> |
| </section> |
| <!-- ======== CONSTRUCTOR SUMMARY ======== --> |
| <section role="region"> |
| <ul class="blockList"> |
| <li class="blockList"><a id="constructor.summary"> |
| <!-- --> |
| </a> |
| <h3>Constructor Summary</h3> |
| <table class="memberSummary"> |
| <caption><span>Constructors</span><span class="tabEnd"> </span></caption> |
| <tr> |
| <th class="colFirst" scope="col">Constructor</th> |
| <th class="colLast" scope="col">Description</th> |
| </tr> |
| <tr class="altColor"> |
| <th class="colConstructorName" scope="row"><code><span class="memberNameLink"><a href="#%3Cinit%3E()">Preferences</a></span>()</code></th> |
| <td class="colLast"> </td> |
| </tr> |
| </table> |
| </li> |
| </ul> |
| </section> |
| <!-- ========== METHOD SUMMARY =========== --> |
| <section role="region"> |
| <ul class="blockList"> |
| <li class="blockList"><a id="method.summary"> |
| <!-- --> |
| </a> |
| <h3>Method Summary</h3> |
| <table class="memberSummary"> |
| <caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd"> </span></span><span id="t1" class="tableTab"><span><a href="javascript:show(1);">Static Methods</a></span><span class="tabEnd"> </span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd"> </span></span></caption> |
| <tr> |
| <th class="colFirst" scope="col">Modifier and Type</th> |
| <th class="colSecond" scope="col">Method</th> |
| <th class="colLast" scope="col">Description</th> |
| </tr> |
| <tr id="i0" class="altColor"> |
| <td class="colFirst"><code>static java.util.ResourceBundle</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getBundle(org.apache.wiki.api.core.Context,java.lang.String)">getBundle</a></span>​(<a href="../api/core/Context.html" title="interface in org.apache.wiki.api.core">Context</a> context, |
| java.lang.String bundle)</code></th> |
| <td class="colLast"> |
| <div class="block">Locates the i18n ResourceBundle given.</div> |
| </td> |
| </tr> |
| <tr id="i1" class="rowColor"> |
| <td class="colFirst"><code>static java.text.SimpleDateFormat</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getDateFormat(org.apache.wiki.api.core.Context,org.apache.wiki.preferences.Preferences.TimeFormat)">getDateFormat</a></span>​(<a href="../api/core/Context.html" title="interface in org.apache.wiki.api.core">Context</a> context, |
| <a href="Preferences.TimeFormat.html" title="enum in org.apache.wiki.preferences">Preferences.TimeFormat</a> tf)</code></th> |
| <td class="colLast"> |
| <div class="block">Get SimpleTimeFormat according to user browser locale and preferred time formats.</div> |
| </td> |
| </tr> |
| <tr id="i2" class="altColor"> |
| <td class="colFirst"><code>static java.util.Locale</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getLocale(org.apache.wiki.api.core.Context)">getLocale</a></span>​(<a href="../api/core/Context.html" title="interface in org.apache.wiki.api.core">Context</a> context)</code></th> |
| <td class="colLast"> |
| <div class="block">Get Locale according to user-preference settings or the user browser locale</div> |
| </td> |
| </tr> |
| <tr id="i3" class="rowColor"> |
| <td class="colFirst"><code>static java.lang.String</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getPreference(javax.servlet.jsp.PageContext,java.lang.String)">getPreference</a></span>​(javax.servlet.jsp.PageContext pageContext, |
| java.lang.String name)</code></th> |
| <td class="colLast"> |
| <div class="block">Returns a preference value programmatically.</div> |
| </td> |
| </tr> |
| <tr id="i4" class="altColor"> |
| <td class="colFirst"><code>static java.lang.String</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getPreference(org.apache.wiki.api.core.Context,java.lang.String)">getPreference</a></span>​(<a href="../api/core/Context.html" title="interface in org.apache.wiki.api.core">Context</a> wikiContext, |
| java.lang.String name)</code></th> |
| <td class="colLast"> |
| <div class="block">Returns a preference value programmatically.</div> |
| </td> |
| </tr> |
| <tr id="i5" class="rowColor"> |
| <td class="colFirst"><code>static void</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#reloadPreferences(javax.servlet.jsp.PageContext)">reloadPreferences</a></span>​(javax.servlet.jsp.PageContext pageContext)</code></th> |
| <td class="colLast"> |
| <div class="block">Reloads the preferences from the PageContext into the WikiContext.</div> |
| </td> |
| </tr> |
| <tr id="i6" class="altColor"> |
| <td class="colFirst"><code>static java.lang.String</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#renderDate(org.apache.wiki.api.core.Context,java.util.Date,org.apache.wiki.preferences.Preferences.TimeFormat)">renderDate</a></span>​(<a href="../api/core/Context.html" title="interface in org.apache.wiki.api.core">Context</a> context, |
| java.util.Date date, |
| <a href="Preferences.TimeFormat.html" title="enum in org.apache.wiki.preferences">Preferences.TimeFormat</a> tf)</code></th> |
| <td class="colLast"> |
| <div class="block">A simple helper function to render a date based on the user preferences.</div> |
| </td> |
| </tr> |
| <tr id="i7" class="rowColor"> |
| <td class="colFirst"><code>static void</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setupPreferences(javax.servlet.jsp.PageContext)">setupPreferences</a></span>​(javax.servlet.jsp.PageContext pageContext)</code></th> |
| <td class="colLast"> |
| <div class="block">This is an utility method which is called to make sure that the |
| JSP pages do have proper access to any user preferences.</div> |
| </td> |
| </tr> |
| </table> |
| <ul class="blockList"> |
| <li class="blockList"><a id="methods.inherited.from.class.java.util.HashMap"> |
| <!-- --> |
| </a> |
| <h3>Methods inherited from class java.util.HashMap</h3> |
| <code>clear, clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, get, getOrDefault, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values</code></li> |
| </ul> |
| <ul class="blockList"> |
| <li class="blockList"><a id="methods.inherited.from.class.java.util.AbstractMap"> |
| <!-- --> |
| </a> |
| <h3>Methods inherited from class java.util.AbstractMap</h3> |
| <code>equals, hashCode, toString</code></li> |
| </ul> |
| <ul class="blockList"> |
| <li class="blockList"><a id="methods.inherited.from.class.java.lang.Object"> |
| <!-- --> |
| </a> |
| <h3>Methods inherited from class java.lang.Object</h3> |
| <code>finalize, getClass, notify, notifyAll, wait, wait, wait</code></li> |
| </ul> |
| <ul class="blockList"> |
| <li class="blockList"><a id="methods.inherited.from.class.java.util.Map"> |
| <!-- --> |
| </a> |
| <h3>Methods inherited from interface java.util.Map</h3> |
| <code>equals, hashCode</code></li> |
| </ul> |
| </li> |
| </ul> |
| </section> |
| </li> |
| </ul> |
| </div> |
| <div class="details"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <!-- ============ FIELD DETAIL =========== --> |
| <section role="region"> |
| <ul class="blockList"> |
| <li class="blockList"><a id="field.detail"> |
| <!-- --> |
| </a> |
| <h3>Field Detail</h3> |
| <a id="SESSIONPREFS"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>SESSIONPREFS</h4> |
| <pre>public static final java.lang.String <a href="../../../../src-html/org/apache/wiki/preferences/Preferences.html#line.57">SESSIONPREFS</a></pre> |
| <div class="block">The name under which a Preferences object is stored in the HttpSession. Its value is "prefs".</div> |
| <dl> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="../../../../constant-values.html#org.apache.wiki.preferences.Preferences.SESSIONPREFS">Constant Field Values</a></dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="COOKIE_USER_PREFS_NAME"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>COOKIE_USER_PREFS_NAME</h4> |
| <pre>public static final java.lang.String <a href="../../../../src-html/org/apache/wiki/preferences/Preferences.html#line.59">COOKIE_USER_PREFS_NAME</a></pre> |
| <dl> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="../../../../constant-values.html#org.apache.wiki.preferences.Preferences.COOKIE_USER_PREFS_NAME">Constant Field Values</a></dd> |
| </dl> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </section> |
| <!-- ========= CONSTRUCTOR DETAIL ======== --> |
| <section role="region"> |
| <ul class="blockList"> |
| <li class="blockList"><a id="constructor.detail"> |
| <!-- --> |
| </a> |
| <h3>Constructor Detail</h3> |
| <a id="<init>()"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>Preferences</h4> |
| <pre>public <a href="../../../../src-html/org/apache/wiki/preferences/Preferences.html#line.50">Preferences</a>()</pre> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </section> |
| <!-- ============ METHOD DETAIL ========== --> |
| <section role="region"> |
| <ul class="blockList"> |
| <li class="blockList"><a id="method.detail"> |
| <!-- --> |
| </a> |
| <h3>Method Detail</h3> |
| <a id="setupPreferences(javax.servlet.jsp.PageContext)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>setupPreferences</h4> |
| <pre class="methodSignature">public static void <a href="../../../../src-html/org/apache/wiki/preferences/Preferences.html#line.77">setupPreferences</a>​(javax.servlet.jsp.PageContext pageContext)</pre> |
| <div class="block">This is an utility method which is called to make sure that the |
| JSP pages do have proper access to any user preferences. It should be |
| called from the commonheader.jsp. |
| <p> |
| This method reads user cookie preferences and mixes them up with any |
| default preferences (and in the future, any user-specific preferences) |
| and puts them all in the session, so that they do not have to be rewritten |
| again. |
| <p> |
| This method will remember if the user has already changed his prefs.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>pageContext</code> - The JSP PageContext.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="reloadPreferences(javax.servlet.jsp.PageContext)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>reloadPreferences</h4> |
| <pre class="methodSignature">public static void <a href="../../../../src-html/org/apache/wiki/preferences/Preferences.html#line.93">reloadPreferences</a>​(javax.servlet.jsp.PageContext pageContext)</pre> |
| <div class="block">Reloads the preferences from the PageContext into the WikiContext.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>pageContext</code> - The page context.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="getPreference(org.apache.wiki.api.core.Context,java.lang.String)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getPreference</h4> |
| <pre class="methodSignature">public static java.lang.String <a href="../../../../src-html/org/apache/wiki/preferences/Preferences.html#line.155">getPreference</a>​(<a href="../api/core/Context.html" title="interface in org.apache.wiki.api.core">Context</a> wikiContext, |
| java.lang.String name)</pre> |
| <div class="block">Returns a preference value programmatically. |
| FIXME</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>wikiContext</code> - </dd> |
| <dd><code>name</code> - </dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the preference value</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="getPreference(javax.servlet.jsp.PageContext,java.lang.String)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getPreference</h4> |
| <pre class="methodSignature">public static java.lang.String <a href="../../../../src-html/org/apache/wiki/preferences/Preferences.html#line.177">getPreference</a>​(javax.servlet.jsp.PageContext pageContext, |
| java.lang.String name)</pre> |
| <div class="block">Returns a preference value programmatically. |
| FIXME</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>pageContext</code> - </dd> |
| <dd><code>name</code> - </dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the preference value</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="getLocale(org.apache.wiki.api.core.Context)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getLocale</h4> |
| <pre class="methodSignature">public static java.util.Locale <a href="../../../../src-html/org/apache/wiki/preferences/Preferences.html#line.193">getLocale</a>​(<a href="../api/core/Context.html" title="interface in org.apache.wiki.api.core">Context</a> context)</pre> |
| <div class="block">Get Locale according to user-preference settings or the user browser locale</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>context</code> - The context to examine.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>a Locale object.</dd> |
| <dt><span class="simpleTagLabel">Since:</span></dt> |
| <dd>2.8</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="getBundle(org.apache.wiki.api.core.Context,java.lang.String)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getBundle</h4> |
| <pre class="methodSignature">public static java.util.ResourceBundle <a href="../../../../src-html/org/apache/wiki/preferences/Preferences.html#line.248">getBundle</a>​(<a href="../api/core/Context.html" title="interface in org.apache.wiki.api.core">Context</a> context, |
| java.lang.String bundle) |
| throws java.util.MissingResourceException</pre> |
| <div class="block">Locates the i18n ResourceBundle given. This method interprets the request locale, and uses that to figure out which language the |
| user wants.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>context</code> - <a href="../api/core/Context.html" title="interface in org.apache.wiki.api.core"><code>Context</code></a> holding the user's locale</dd> |
| <dd><code>bundle</code> - The name of the bundle you are looking for.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>A localized string (or from the default language, if not found)</dd> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code>java.util.MissingResourceException</code> - If the bundle cannot be found</dd> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="../i18n/InternationalizationManager.html" title="interface in org.apache.wiki.i18n"><code>InternationalizationManager</code></a></dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="getDateFormat(org.apache.wiki.api.core.Context,org.apache.wiki.preferences.Preferences.TimeFormat)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getDateFormat</h4> |
| <pre class="methodSignature">public static java.text.SimpleDateFormat <a href="../../../../src-html/org/apache/wiki/preferences/Preferences.html#line.263">getDateFormat</a>​(<a href="../api/core/Context.html" title="interface in org.apache.wiki.api.core">Context</a> context, |
| <a href="Preferences.TimeFormat.html" title="enum in org.apache.wiki.preferences">Preferences.TimeFormat</a> tf)</pre> |
| <div class="block">Get SimpleTimeFormat according to user browser locale and preferred time formats. If not found, it will revert to whichever format |
| is set for the default.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>context</code> - WikiContext to use for rendering.</dd> |
| <dd><code>tf</code> - Which version of the dateformat you are looking for?</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>A SimpleTimeFormat object which you can use to render</dd> |
| <dt><span class="simpleTagLabel">Since:</span></dt> |
| <dd>2.8</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="renderDate(org.apache.wiki.api.core.Context,java.util.Date,org.apache.wiki.preferences.Preferences.TimeFormat)"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>renderDate</h4> |
| <pre class="methodSignature">public static java.lang.String <a href="../../../../src-html/org/apache/wiki/preferences/Preferences.html#line.316">renderDate</a>​(<a href="../api/core/Context.html" title="interface in org.apache.wiki.api.core">Context</a> context, |
| java.util.Date date, |
| <a href="Preferences.TimeFormat.html" title="enum in org.apache.wiki.preferences">Preferences.TimeFormat</a> tf)</pre> |
| <div class="block">A simple helper function to render a date based on the user preferences. This is useful for example for all plugins.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>context</code> - The context which is used to get the preferences</dd> |
| <dd><code>date</code> - The date to render.</dd> |
| <dd><code>tf</code> - In which format the date should be rendered.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>A ready-rendered date.</dd> |
| <dt><span class="simpleTagLabel">Since:</span></dt> |
| <dd>2.8</dd> |
| </dl> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </section> |
| </li> |
| </ul> |
| </div> |
| </div> |
| </main> |
| <!-- ========= END OF CLASS DATA ========= --> |
| <footer role="contentinfo"> |
| <nav role="navigation"> |
| <!-- ======= START OF BOTTOM NAVBAR ====== --> |
| <div class="bottomNav"><a id="navbar.bottom"> |
| <!-- --> |
| </a> |
| <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> |
| <a id="navbar.bottom.firstrow"> |
| <!-- --> |
| </a> |
| <ul class="navList" title="Navigation"> |
| <li><a href="../../../../index.html">Overview</a></li> |
| <li><a href="package-summary.html">Package</a></li> |
| <li class="navBarCell1Rev">Class</li> |
| <li><a href="class-use/Preferences.html">Use</a></li> |
| <li><a href="package-tree.html">Tree</a></li> |
| <li><a href="../../../../deprecated-list.html">Deprecated</a></li> |
| <li><a href="../../../../index-all.html">Index</a></li> |
| <li><a href="../../../../help-doc.html">Help</a></li> |
| </ul> |
| </div> |
| <div class="subNav"> |
| <ul class="navList" id="allclasses_navbar_bottom"> |
| <li><a href="../../../../allclasses.html">All Classes</a></li> |
| </ul> |
| <div> |
| <script type="text/javascript"><!-- |
| allClassesLink = document.getElementById("allclasses_navbar_bottom"); |
| if(window==top) { |
| allClassesLink.style.display = "block"; |
| } |
| else { |
| allClassesLink.style.display = "none"; |
| } |
| //--> |
| </script> |
| <noscript> |
| <div>JavaScript is disabled on your browser.</div> |
| </noscript> |
| </div> |
| <div> |
| <ul class="subNavList"> |
| <li>Summary: </li> |
| <li><a href="#nested.class.summary">Nested</a> | </li> |
| <li><a href="#field.summary">Field</a> | </li> |
| <li><a href="#constructor.summary">Constr</a> | </li> |
| <li><a href="#method.summary">Method</a></li> |
| </ul> |
| <ul class="subNavList"> |
| <li>Detail: </li> |
| <li><a href="#field.detail">Field</a> | </li> |
| <li><a href="#constructor.detail">Constr</a> | </li> |
| <li><a href="#method.detail">Method</a></li> |
| </ul> |
| </div> |
| <a id="skip.navbar.bottom"> |
| <!-- --> |
| </a></div> |
| <!-- ======== END OF BOTTOM NAVBAR ======= --> |
| </nav> |
| <p class="legalCopy"><small>Copyright (c) 2001-2023 The Apache Software Foundation. All rights reserved.</small></p> |
| </footer> |
| </body> |
| </html> |