Example usage for org.springframework.context.support ReloadableResourceBundleMessageSource clearCacheIncludingAncestors

List of usage examples for org.springframework.context.support ReloadableResourceBundleMessageSource clearCacheIncludingAncestors

Introduction

In this page you can find the example usage for org.springframework.context.support ReloadableResourceBundleMessageSource clearCacheIncludingAncestors.

Prototype

public void clearCacheIncludingAncestors() 

Source Link

Document

Clear the resource bundle caches of this MessageSource and all its ancestors.

Usage

From source file:org.web4thejob.web.panel.DefaultDesktopLayoutPanel.java

@Override
protected void processValidCommand(Command command) {
    if (CommandEnum.SESSION_INFO.equals(command.getId())) {
        SessionInfoPanel panel = ContextUtil.getDefaultPanel(SessionInfoPanel.class);
        dispatchMessage(ContextUtil.getMessage(MessageEnum.ADOPT_ME, panel));
    } else if (CommandEnum.DESIGN_PANEL_ENTITY_VIEW.equals(command.getId())) {
        displayPanelForDesign(ContextUtil.getDefaultPanel(MutableEntityViewPanel.class));
    } else if (CommandEnum.DESIGN_PANEL_LIST_VIEW.equals(command.getId())) {
        displayPanelForDesign(ContextUtil.getDefaultPanel(ListViewPanel.class));
    } else if (CommandEnum.DESIGN_PANEL_HTML_VIEW.equals(command.getId())) {
        displayPanelForDesign(ContextUtil.getDefaultPanel(HtmlViewPanel.class));
    } else if (CommandEnum.DESIGN_PANEL_IFRAME_VIEW.equals(command.getId())) {
        displayPanelForDesign(ContextUtil.getDefaultPanel(FramePanel.class));
    } else if (CommandEnum.DESIGN_PANEL_TABBED_VIEW.equals(command.getId())) {
        displayPanelForDesign(ContextUtil.getDefaultPanel(TabbedLayoutPanel.class));
    } else if (CommandEnum.DESIGN_PANEL_BORDERED_VIEW.equals(command.getId())) {
        displayPanelForDesign(ContextUtil.getDefaultPanel(BorderedLayoutPanel.class));
    } else if (CommandEnum.DESIGN_PANEL_OTHER.equals(command.getId())) {
        Dialog dialog = ContextUtil.getDefaultDialog(SelectPanelDialog.class);
        dialog.setInDesignMode(isInDesignMode());
        dialog.setL10nMode(getL10nMode());
        dialog.show(new SelectPanelResponse());
    } else if (CommandEnum.REFRESH_CONTEXT.equals(command.getId())) {
        ContextUtil.getSessionContext().refresh();
        ContextUtil.getDRS().evictCache();
        ReloadableResourceBundleMessageSource messageSource = ContextUtil
                .getBean(ReloadableResourceBundleMessageSource.class);
        messageSource.clearCacheIncludingAncestors();
    } else if (CommandEnum.DESIGN_MODE.equals(command.getId())) {
        final boolean designMode = (Boolean) command.getValue();
        setInDesignMode(designMode);/*from   www  . j a v  a2s  .com*/
        render();
    } else if (CommandEnum.LOCALIZATION_MODE.equals(command.getId())) {
        final boolean l12nMode = (Boolean) command.getValue();
        setL10nMode(l12nMode);
        render();
    } else if (CommandEnum.LOGOUT.equals(command.getId())) {
        Messagebox.show(L10N_QUESTION_LOGOUT.toString(), L10nMessages.L10N_MSGBOX_TITLE_QUESTION.toString(),
                new Messagebox.Button[] { Messagebox.Button.OK, Messagebox.Button.CANCEL }, Messagebox.QUESTION,
                new EventListener<Messagebox.ClickEvent>() {
                    @Override
                    public void onEvent(Messagebox.ClickEvent event) throws Exception {
                        if (event.getButton() == Messagebox.Button.OK) {
                            Executions.sendRedirect("j_spring_security_logout");
                        }
                    }
                });
    } else if (CommandEnum.SAVE_DESKTOP.equals(command.getId())) {
        saveDesktop();
    } else if (CommandEnum.CHANGE_PASSWORD.equals(command.getId())) {
        changePassword();
    } else if (CommandEnum.ABOUT.equals(command.getId())) {
        AboutDialog aboutDialog = ContextUtil.getDefaultDialog(AboutDialog.class);
        aboutDialog.show(null);
    } else {
        super.processValidCommand(command);
    }
}