本文整理匯總了Java中com.atlassian.confluence.user.ConfluenceUserPreferences類的典型用法代碼示例。如果您正苦於以下問題:Java ConfluenceUserPreferences類的具體用法?Java ConfluenceUserPreferences怎麽用?Java ConfluenceUserPreferences使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
ConfluenceUserPreferences類屬於com.atlassian.confluence.user包,在下文中一共展示了ConfluenceUserPreferences類的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: newFriendlyDateFormatter
import com.atlassian.confluence.user.ConfluenceUserPreferences; //導入依賴的package包/類
protected FriendlyDateFormatter newFriendlyDateFormatter() {
// Get current user's timezone, or default one
User authUser = AuthenticatedUserThreadLocal.getUser();
TimeZone timeZone;
if (authUser == null) {
// anonymous
timeZone = TimeZone.getDefault();
} else {
ConfluenceUserPreferences prefs = userAccessor
.getConfluenceUserPreferences(authUser);
timeZone = prefs.getTimeZone();
}
// Build date formatter
DateFormatter dateFormatter = new DateFormatter(timeZone,
formatSettingsManager, localeManager);
// Build "friendly" date formatter
FriendlyDateFormatter friendlyDateFormatter = new FriendlyDateFormatter(
new Date(), dateFormatter);
return friendlyDateFormatter;
}
示例2: newNumberFormatter
import com.atlassian.confluence.user.ConfluenceUserPreferences; //導入依賴的package包/類
protected NumberFormat newNumberFormatter() {
// Get current user's timezone, or default one
User authUser = AuthenticatedUserThreadLocal.getUser();
NumberFormat result = null;
if (authUser != null) {
ConfluenceUserPreferences prefs = userAccessor
.getConfluenceUserPreferences(authUser);
if (prefs != null && prefs.getLocale() != null) {
result = NumberFormat.getNumberInstance(prefs.getLocale());
}
}
if (result == null) {
// anonymous
result = NumberFormat.getNumberInstance();
}
return result;
}
示例3: getUserPreferencesDateFormatter
import com.atlassian.confluence.user.ConfluenceUserPreferences; //導入依賴的package包/類
public DateFormatter getUserPreferencesDateFormatter()
{
ConfluenceUserPreferences preferences = getUserAccessor().getConfluenceUserPreferences(getRemoteUser());
return preferences.getDateFormatter(getFormatSettingsManager());
}
示例4: getUserPreferencesDateFormatter
import com.atlassian.confluence.user.ConfluenceUserPreferences; //導入依賴的package包/類
/**
* <p>getUserPreferencesDateFormatter.</p>
*
* @return a {@link com.atlassian.confluence.core.DateFormatter} object.
*/
public DateFormatter getUserPreferencesDateFormatter() {
ConfluenceUserPreferences preferences = getUserAccessor().getConfluenceUserPreferences(getRemoteUser());
return preferences.getDateFormatter(getFormatSettingsManager());
}
示例5: getCustomizedPreferencesDateFormatter
import com.atlassian.confluence.user.ConfluenceUserPreferences; //導入依賴的package包/類
public DateFormatter getCustomizedPreferencesDateFormatter(FormatSettingsManager formatSettingsManager) {
ConfluenceUserPreferences preferences = getUserAccessor().getConfluenceUserPreferences(getRemoteUser());
return preferences.getDateFormatter(formatSettingsManager, getLocaleManager());
}