本文整理汇总了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());
}