Package pl.net.bluesoft.rnd.util.i18n

Examples of pl.net.bluesoft.rnd.util.i18n.I18NSource$ThreadUtil


    }

    @Override
    public Collection<PermissionDefinition> getPermissionDefinitions() {
        if (definitions == null) {
            I18NSource messages = I18NSource.ThreadUtil.getThreadI18nSource();

            definitions = new ArrayList<PermissionDefinition>();
            definitions.add(new PermissionDefinition("INCLUDE", messages.getMessage("process.permission.INCLUDE")));
            definitions.add(new PermissionDefinition("RUN", messages.getMessage("process.permission.RUN")));
            definitions.add(new PermissionDefinition("SEARCH", messages.getMessage("process.permission.SEARCH")));
        }
        return definitions;
    }
View Full Code Here


        // no point to reset the default logo
        logoResetButton.setEnabled(false);
    }

    private void initComponent() {
        I18NSource messages = I18NSource.ThreadUtil.getThreadI18nSource();

        logoUploader = new ProcessLogoUploader();
        logoUploader.setProcessLogoHandler(this);

        logoDescriptionLabel = new Label(messages.getMessage(
                "process.logo.description",
                new Object[] { humanReadableByteCount(ModelConstants.PROCESS_LOGO_FILE_SIZE, false) }
        ));

        logoResetButton = new Button(messages.getMessage("process.logo.reset"));
        logoResetButton.addListener(new Button.ClickListener() {
            @Override
            public void buttonClick(Button.ClickEvent event) {
                handleProcessLogo(null);
            }
View Full Code Here

    }
    }

    @Override
    public void onTabClose(TabSheet tabsheet, final Component tabContent) {
        I18NSource messages  = I18NSource.ThreadUtil.getThreadI18nSource();

        String langCode = "UNKNOWN";
        if (tabContent instanceof PropertiesArea) {
            PropertiesArea props = (PropertiesArea) tabContent;
            langCode = props.getLanguage().getCode();
        }

        ConfirmWindow confirmWindow = new ConfirmWindow();
        confirmWindow.setMessageValue(messages.getMessage(
                "messages.language.delete.warning",
                new Object[]{langCode})
        );
        confirmWindow.setConfirmCaption(messages.getMessage("messages.language.delete.yes"));
        confirmWindow.setCancelCaption(messages.getMessage("messages.language.delete.no"));
        confirmWindow.addConfirmListener(new Button.ClickListener() {
            @Override
            public void buttonClick(Button.ClickEvent event) {
                removeLanguageTab(tabContent);
            }
View Full Code Here

    addComponent(defaultLanguageSelect);
        addComponent(languageTabs);
    }

    private void initComponent() {
        I18NSource messages = I18NSource.ThreadUtil.getThreadI18nSource();

        newLanguageButton = VaadinUtility.button(
                messages.getMessage("messages.language.new.button"),
                new Runnable() {
                    @Override
                    public void run() {
                        Window window = new NewLanguageWindow();
                        MessageEditor.this.getApplication().getMainWindow().addWindow(window);
                    }
                }
        );

    defaultLanguageSelect = new Select(messages.getMessage("messages.default.language"));
    defaultLanguageSelect.setWidth(150, UNITS_PIXELS);

        languageDescriptionLabel = new Label(messages.getMessage("messages.language.description"));

        languageTabs = new TabSheet();
        languageTabs.setCloseHandler(this);
    }
View Full Code Here

            initComponent();
            initLayout();
        }

        private void initComponent() {
            I18NSource messages  = I18NSource.ThreadUtil.getThreadI18nSource();

            setCaption(messages.getMessage("messages.language.new.caption"));
           
            languageForm = new LanguageForm();

            addButton = VaadinUtility.button(
                    messages.getMessage("messages.language.new.add"),
                    new Runnable() {
                        @Override
                        public void run() {
                            languageForm.commit();

                            Language lang = languageForm.getLanguage();
                            if (languageProperties.containsKey(lang)) {
                                I18NSource messages = I18NSource.ThreadUtil.getThreadI18nSource();
                                VaadinUtility.errorNotification(
                                        getApplication(),
                                        messages,
                                        messages.getMessage("messages.language.new.exists")
                                );
                                return;
                            }

                            addLanguageTab(lang, null);
View Full Code Here

            // so we do this here, otherwise error in receiveUpload can be swallowed
            return;
        }
       
        if (maxFileSize > 0 && (maxFileSize < readBytes || (contentLength != -1 && maxFileSize < contentLength))) {
            I18NSource messages = I18NSource.ThreadUtil.getThreadI18nSource();
            setUploadFailedNotification(messages.getMessage("uploader.size.exceeded"));
            upload.interruptUpload();
        }

        float progress = ((float) readBytes) / ((float) contentLength);
        if (progress > 1) {
View Full Code Here

    @Override
    public OutputStream receiveUpload(String filename, String mimeType) {
        out = null;

        I18NSource message = I18NSource.ThreadUtil.getThreadI18nSource();

        if (!allowedMimeTypes.isEmpty() && !allowedMimeTypes.contains(mimeType)) {
            logger.log(Level.INFO, "Disallowed mimeType " + mimeType);
            setUploadFailedNotification(message.getMessage("uploader.mimeType.disallowed", new Object[] { mimeType }));
        } else {
            try {
                out = createOutputStream();
            } catch (Exception e) {
                logger.log(Level.SEVERE, "Failed to create output stream", e);
                setUploadFailedNotification(message.getMessage("uploader.out.failed"));
            }
        }
       
        if (out == null) {
            // No valid output, interrupt and return fake
View Full Code Here

  protected void writeAjaxPageHtmlVaadinScripts(RenderRequest request, RenderResponse response, BufferedWriter writer, Application application, String themeName) throws IOException, PortletException {
    response.createResourceURL().setParameter("img", "loader");

    this.application = application;
   
    I18NSource i18NSource = I18NSourceFactory.createI18NSource(request.getLocale());
    writer.write(String.format("<div name='%s'>%s</div>",
        getLoaderTagId(request.getWindowID(), getPortletConfig()),
        i18NSource.getMessage("loader.message")));
   
    super.writeAjaxPageHtmlVaadinScripts(request, response,  writer,  application, themeName);
 
View Full Code Here

        Map<String, Object> templateData = new HashMap<String, Object>();
        if (task != null) {
            templateData.put(_TASK, task);

            Locale locale = Strings.hasText(cfg.getLocale()) ? new Locale(cfg.getLocale()) : Locale.getDefault();
            I18NSource messageSource = I18NSourceFactory.createI18NSource(locale);

      pi = ctx.getProcessInstanceDAO().refresh(pi);

      for (ProcessStateConfiguration st : pi.getDefinition().getStates()) {
                if (task.getTaskName().equals(st.getName())) {
                    templateData.put(_TASK_NAME, messageSource.getMessage(st.getDescription()));
                    break;
                }
            }

            templateData.put(_TASK_URL, getTaskLink(task, ctx));
View Full Code Here

    public void setProcessConfig(ProcessConfig processConfig) {
        this.processConfig = processConfig;
    }

    private void initComponent() {
        I18NSource messages = I18NSource.ThreadUtil.getThreadI18nSource();

        descriptionLabel = styled(new Label(messages.getMessage("process.definition.description")), "h2");
        descriptionInfoLabel = htmlLabel(messages.getMessage("process.definition.description.info"));
        descriptionField = new TextField();
        descriptionField.setNullRepresentation("");
        descriptionField.setWidth("100%");

        commentLabel = styled(new Label(messages.getMessage("process.definition.comment")), "h2");
        commentInfoLabel = htmlLabel(messages.getMessage("process.definition.comment.info"));
        commentArea = new RichTextArea();
        commentArea.setNullRepresentation("");
        commentArea.setWidth("100%");
    }
View Full Code Here

TOP

Related Classes of pl.net.bluesoft.rnd.util.i18n.I18NSource$ThreadUtil

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.