@Override public String getMessage(String key) { return i18NSource.getMessage(key, key); }
public String getMessage(String key) { return source.getMessage(key); }
public static String getDayMonthFormatStr(I18NSource i18NSource) { return i18NSource.getMessage("format.day.month.date"); }
public static String getParametrizedLocalizedMessage(String key, Object... parameters) { return I18NSource.ThreadUtil.getThreadI18nSource().getMessage( (key.startsWith("processdata") ? "" : "widget.process_data_block.editor.") + key, parameters ); }
@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; }
@Override public void updateProgress(long readBytes, long contentLength) { pi.setValue(new Float(readBytes / (float) contentLength)); textualProgress.setValue(i18NSource.getMessage(PROGRESS_PROCESSED).replaceFirst("%s", "" + readBytes).replaceFirst("%s", "" + contentLength)); }
public void onThrowable(Throwable e) { logger.log(Level.SEVERE, e.getMessage(), e); if (e instanceof TaskAlreadyCompletedException) { VaadinUtility.errorNotification(this, i18NSource, i18NSource.getMessage("task.already.completed")); } else { ByteArrayOutputStream baos = new ByteArrayOutputStream(); e.printStackTrace(new PrintStream(baos)); getMainWindow().showNotification(VaadinUtility.validationNotification(i18NSource.getMessage("process-tool.exception.occurred"), getMessage(e.getMessage()))); } }
public UserStepEditorWindow(StepEditorApplication application, String jsonConfig, String url, String stepName, String stepType) { super(application, jsonConfig, url, stepName, stepType); permissions = new LinkedHashSet<Permission>(); actionDelete = new Action(I18NSource.ThreadUtil.getThreadI18nSource().getMessage("stepTree.action.delete")); actions = new Action[] { actionDelete }; }
private String getDescription(PermissionDefinition definition) { StringBuilder builder = new StringBuilder(); builder.append("<h2>"); builder.append(definition.getKey()); builder.append("</h2>"); if (definition.getDescription() != null && !definition.getDescription().trim().isEmpty()) { builder.append("<i>"); builder.append(I18NSource.ThreadUtil.getThreadI18nSource().getMessage(definition.getDescription())); builder.append("</i>"); } return builder.toString(); }
public Label getHeaderLabel() { I18NSource messages = I18NSource.ThreadUtil.getThreadI18nSource(); Label headerLabel = new Label(); if (stepName != null && !stepName.isEmpty()) { headerLabel.setValue(messages.getMessage("userStep.stepName", new Object[] { stepName })); } else { headerLabel.setValue(messages.getMessage("userStep.noStepName")); } headerLabel.addStyleName("h1"); return headerLabel; }
@Override public void uploadFailed(FailedEvent event) { baos = null; failedMessage.setValue("<b>" + i18NSource.getMessage(PROGRESS_FAILED).replaceFirst("%s", "" + Math.round(100 * (Float) pi.getValue())) + "</b>"); mainPanel.addComponent(failedMessage); downloadFile.setEnabled(canDownload()); }
public static void validationNotification(Application application, I18NSource messageSource, String errorMessage) { Notification notification = new Notification(messageSource.getMessage("process.data.data-error"), "<br/>" + errorMessage, Notification.TYPE_ERROR_MESSAGE); notification.setStyleName("invalid"); application.getMainWindow().showNotification(notification); }
@Override 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); } @Override
public static void errorNotification(Application application, I18NSource messageSource, String message) { Notification notification = new Notification(messageSource.getMessage("notification.error"), "<br/><b>" + message + "</b>", TYPE_ERROR_MESSAGE); notification.setPosition(POSITION_CENTERED); notification.setStyleName("error"); application.getMainWindow().showNotification(notification); }
private Component getAddEntryButton() { if (addEntryButton == null) { I18NSource i18NSource = I18NSource.ThreadUtil.getThreadI18nSource(); addEntryButton = addIcon(getApplication()); addEntryButton.setCaption(i18NSource.getMessage("dict.addentry")); addEntryButton.addListener(this); } return addEntryButton; }
private void initComponents(){ I18NSource messages = I18NSource.ThreadUtil.getThreadI18nSource(); taskItemClassLabel = styled(new Label(messages.getMessage("process.definition.taskItemClass")), "h2"); taskItemClassField = new Select(); taskItemClassField.setNewItemsAllowed(true); taskItemClassField.setWidth("100%"); }
@Override public void init() { super.init(); I18NSource messages = I18NSource.ThreadUtil.getThreadI18nSource(); mainWindow = new Window(messages.getMessage("process.editor.title")); mainWindow.addParameterHandler(this); mainWindowJavaScriptHelper = new JavaScriptHelper(mainWindow); mainWindowJavaScriptHelper.preventWindowClosing(); setMainWindow(mainWindow); }
@Override public void init() { super.init(); mainWindow = new Window(I18NSource.ThreadUtil.getThreadI18nSource().getMessage("application.title")); mainWindow.addParameterHandler(this); jsHelper = new JavaScriptHelper(mainWindow); jsHelper.preventWindowClosing(); setMainWindow(mainWindow); }
@Override public void init() { super.init(); mainWindow = new Window(I18NSource.ThreadUtil.getThreadI18nSource().getMessage("application.title")); jsHelper = new JavaScriptHelper(mainWindow); jsHelper.preventWindowClosing(); mainWindow.addParameterHandler(this); setMainWindow(mainWindow); }
public FileUploadComponent(I18NSource i18NSource) { this.i18NSource = i18NSource; uploadFile.addStyleName("default"); uploadFile.setButtonCaption(i18NSource.getMessage(UPLOAD_START)); uploadFile.addListener((FailedListener) this); uploadFile.addListener((FinishedListener) this); uploadFile.addListener((ProgressListener) this); uploadFile.addListener((StartedListener) this); uploadFile.addListener((SucceededListener) this); mainPanel.setMargin(true); initView(); setCompositionRoot(mainPanel); }