• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java ITheme类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中de.agilecoders.wicket.core.settings.ITheme的典型用法代码示例。如果您正苦于以下问题:Java ITheme类的具体用法?Java ITheme怎么用?Java ITheme使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ITheme类属于de.agilecoders.wicket.core.settings包,在下文中一共展示了ITheme类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: getActiveTheme

import de.agilecoders.wicket.core.settings.ITheme; //导入依赖的package包/类
@Override
public ITheme getActiveTheme() {
    if(getIsisSessionFactory().getSpecificationLoader().isInitialized()) {
        final String themeName = getIsisSessionFactory().doInSession(() -> {
            final String currentUserName = currentUserName();

            final Class<UserSettingsService> serviceClass = UserSettingsService.class;
            final UserSettingsService userSettingsService = lookupService(serviceClass);

            final UserSetting activeTheme = userSettingsService.find(currentUserName, ACTIVE_THEME);
            return activeTheme != null ? activeTheme.valueAsString() : null;
        });
        return themeFor(themeName);
    }
    return new SessionThemeProvider().getActiveTheme();
}
 
开发者ID:incodehq,项目名称:ecpcrm,代码行数:17,代码来源:EcpCrmUserSettingsThemeProvider.java


示例2: ExampleThemeProvider

import de.agilecoders.wicket.core.settings.ITheme; //导入依赖的package包/类
public ExampleThemeProvider() {
    defaultTheme(new DefaultThemeProvider().defaultTheme());
    final Map<String, ITheme> themes = new HashMap<String, ITheme>();
    themes.put(defaultTheme().name(), defaultTheme());
    addThemes(themes);
    addThemeProviders(themes);
    final Comparator<ITheme> comparator = new Comparator<ITheme>() {
        @Override
        public int compare(final ITheme o1, final ITheme o2) {
            return o1.name().compareToIgnoreCase(o2.name());
        }
    };
    final List<ITheme> sortedThemes = new ArrayList<ITheme>(themes.values());
    Collections.sort(sortedThemes, comparator);
    for (final ITheme theme : sortedThemes) {
        add(theme);
    }
}
 
开发者ID:subes,项目名称:invesdwin-nowicket,代码行数:19,代码来源:ExampleThemeProvider.java


示例3: themeFor

import de.agilecoders.wicket.core.settings.ITheme; //导入依赖的package包/类
private ITheme themeFor(final String themeName) {
    final ThemeProvider themeProvider = settings.getThemeProvider();
    if(themeName != null) {
        for (final ITheme theme : themeProvider.available()) {
            if (themeName.equals(theme.name()))
                return theme;
        }
    }
    return themeProvider.defaultTheme();
}
 
开发者ID:incodehq,项目名称:ecpcrm,代码行数:11,代码来源:EcpCrmUserSettingsThemeProvider.java


示例4: addThemeProviders

import de.agilecoders.wicket.core.settings.ITheme; //导入依赖的package包/类
private void addThemeProviders(final Map<String, ITheme> themes) {
    for (final ThemeProvider provider : THEME_PROVIDERS) {
        for (final ITheme theme : provider.available()) {
            themes.put(theme.name(), theme);
        }
    }
}
 
开发者ID:subes,项目名称:invesdwin-nowicket,代码行数:8,代码来源:ExampleThemeProvider.java


示例5: getActiveTheme

import de.agilecoders.wicket.core.settings.ITheme; //导入依赖的package包/类
@Override
public ITheme getActiveTheme() {
    final String themeName = getIsisSessionFactory().doInSession(() -> {
        final Class<UserSettingsService> serviceClass = UserSettingsService.class;
        final UserSettingsService userSettingsService = lookupService(serviceClass);
        final UserSetting activeTheme = userSettingsService.find(getIsisSessionFactory().getCurrentSession().getAuthenticationSession().getUserName(), ACTIVE_THEME);
        return activeTheme != null ? activeTheme.valueAsString() : null;
    });
    return themeFor(themeName);
}
 
开发者ID:isisaddons,项目名称:isis-app-todoapp,代码行数:11,代码来源:UserSettingsThemeProvider.java


示例6: setActiveTheme

import de.agilecoders.wicket.core.settings.ITheme; //导入依赖的package包/类
@Override
public void setActiveTheme(final ITheme theme) {
    setActiveTheme(theme.name());
}
 
开发者ID:incodehq,项目名称:ecpcrm,代码行数:5,代码来源:EcpCrmUserSettingsThemeProvider.java


示例7: addDefaultTheme

import de.agilecoders.wicket.core.settings.ITheme; //导入依赖的package包/类
@Override
public DefaultThemeProvider addDefaultTheme(final ITheme theme) {
    //ignore this call in super constructor to have a proper alphabetical ordering of themes
    return this;
}
 
开发者ID:subes,项目名称:invesdwin-nowicket,代码行数:6,代码来源:ExampleThemeProvider.java


示例8: addThemes

import de.agilecoders.wicket.core.settings.ITheme; //导入依赖的package包/类
private void addThemes(final Map<String, ITheme> themes) {
    for (final ITheme theme : THEMES) {
        themes.put(theme.name(), theme);
    }
}
 
开发者ID:subes,项目名称:invesdwin-nowicket,代码行数:6,代码来源:ExampleThemeProvider.java


示例9: addThemesNav

import de.agilecoders.wicket.core.settings.ITheme; //导入依赖的package包/类
private void addThemesNav(final Navbar navbar, final ComponentPosition position) {
    final DropDownButton dropdown = new NavbarDropDownButton(Model.of(" Themes")) {

        @Override
        public boolean isActive(final Component item) {
            return false;
        }

        @Override
        protected List<AbstractLink> newSubMenuButtons(final String buttonMarkupId) {
            final List<AbstractLink> subMenu = new ArrayList<AbstractLink>();
            final IBootstrapSettings settings = Bootstrap.getSettings(getApplication());
            final List<ITheme> themes = settings.getThemeProvider().available();

            for (final ITheme theme : themes) {
                final PageParameters params = new PageParameters();
                final String themeName = theme.name();
                params.set(PAGE_PARAM_THEME, themeName);

                final IModel<String> labelModel = new AbstractReadOnlyModel<String>() {
                    @Override
                    public String getObject() {
                        final String activeThemeName = Bootstrap.getSettings(getApplication())
                                .getActiveThemeProvider()
                                .getActiveTheme()
                                .name();
                        String themeLabel = themeName.toLowerCase();
                        if (themeName.equals(activeThemeName)) {
                            themeLabel = "<b>" + themeLabel + "</b>";
                        }
                        return themeLabel;
                    }
                };

                subMenu.add(new MenuBookmarkablePageLink<Void>(getPageClass(), params, labelModel) {

                    @Override
                    protected Component newLabel(final String markupId) {
                        final Label label = (Label) super.newLabel(markupId);
                        label.setEscapeModelStrings(false);
                        return label;
                    }

                });
            }

            return subMenu;
        }
    }.setIconType(GlyphIconType.book);
    navbar.addComponents(new ImmutableNavbarComponent(dropdown, position));
}
 
开发者ID:subes,项目名称:invesdwin-nowicket,代码行数:52,代码来源:AExampleWebPage.java


示例10: activeTheme

import de.agilecoders.wicket.core.settings.ITheme; //导入依赖的package包/类
protected ITheme activeTheme() {
    IBootstrapSettings settings = Bootstrap.getSettings(getApplication());

    return settings.getActiveThemeProvider().getActiveTheme();
}
 
开发者ID:mpostelnicu,项目名称:wicket-spring-jpa-bootstrap-boilerplate,代码行数:6,代码来源:AbstractWebPage.java


示例11: byName

import de.agilecoders.wicket.core.settings.ITheme; //导入依赖的package包/类
@Override
public ITheme byName(String name) {
    return theme;
}
 
开发者ID:Evolveum,项目名称:gizmo-v3,代码行数:5,代码来源:GizmoThemeProvider.java


示例12: available

import de.agilecoders.wicket.core.settings.ITheme; //导入依赖的package包/类
@Override
public List<ITheme> available() {
    return Arrays.asList(new ITheme[]{theme});
}
 
开发者ID:Evolveum,项目名称:gizmo-v3,代码行数:5,代码来源:GizmoThemeProvider.java


示例13: defaultTheme

import de.agilecoders.wicket.core.settings.ITheme; //导入依赖的package包/类
@Override
public ITheme defaultTheme() {
    return theme;
}
 
开发者ID:Evolveum,项目名称:gizmo-v3,代码行数:5,代码来源:GizmoThemeProvider.java



注:本文中的de.agilecoders.wicket.core.settings.ITheme类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ProposeVerbHandler类代码示例发布时间:2022-05-23
下一篇:
Java ParameterParser类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap