public Object getObject() { if (StringResourceModel.this.component != null) { return StringResourceModel.this.getObject(); } else { // TODO: Remove this as soon as we can break binary compatibility StringResourceModel.this.component = this.component; Object res = StringResourceModel.this.getObject(); StringResourceModel.this.component = null; return res; } }
@Override protected String load() { if (StringResourceModel.this.component != null) { // ignore assignment if component was specified explicitly return StringResourceModel.this.getObject(); } else { return getString(component); } }
@Override protected String load() { ISortableDataProvider<Node> provider = UnpublishedReferencesView.this.provider; if (provider.size() > 1) { return new StringResourceModel("message", UnpublishedReferencesView.this, new Model(provider)) .getObject(); } else if (provider.size() == 1) { return new StringResourceModel("message-single", UnpublishedReferencesView.this, null).getObject(); } else { return new StringResourceModel("message-empty", UnpublishedReferencesView.this, null).getObject(); } }
/** * Builds error message with subTypeNames. * * @param subTypeNames names of subTypes where the field exists. * @return the formatted error message. */ private String buildErrorMessage(String field, List<String> subTypeNames) { final String[] types = subTypeNames.toArray(new String[subTypeNames.size()]); StringResourceModel srm = new StringResourceModel("field-is-inherited", this, null, new String[]{field, Strings.join(", ", types)}); return srm.getObject(); }
@Override protected void viewTaskDetails(final PropagationTaskTO taskTO, final AjaxRequestTarget target) { tasks.next( new StringResourceModel("task.view.details", this, new Model<>(Pair.of(null, taskTO))). getObject(), new TaskAttributesDetailsView(baseModal, taskTO, pageReference), target); } });
@Override protected void viewTask(final NotificationTaskTO taskTO, final AjaxRequestTarget target) { mlp.next( new StringResourceModel("task.view", this, new Model<>(Pair.of(null, taskTO))).getObject(), new TaskExecutionDetails<>(null, taskTO, pageReference), target); }
@Override protected void viewTask(final PropagationTaskTO taskTO, final AjaxRequestTarget target) { mlp.next( new StringResourceModel("task.view", this, new Model<>(Pair.of(null, taskTO))).getObject(), new TaskExecutionDetails<>(baseModal, taskTO, pageReference), target); }
@Override protected void viewTask(final PropagationTaskTO taskTO, final AjaxRequestTarget target) { tasks.next( new StringResourceModel("task.view", this, new Model<>(Pair.of(null, taskTO))).getObject(), new TaskExecutionDetails<>(baseModal, taskTO, pageReference), target); }
@Override protected void viewTask(final PushTaskTO taskTO, final AjaxRequestTarget target) { mlp.next( new StringResourceModel("task.view", this, new Model<>(Pair.of(null, taskTO))).getObject(), new TaskExecutionDetails<>(baseModal, taskTO, pageReference), target); } });
@Override public void onComponentTag(final Component component, final ComponentTag tag) { tag.put("title", new StringResourceModel("plugin.display.enabled.label.title", ResourceBundlePlugin.this, null).getObject()); } })
@Override public void onComponentTag(final Component component, final ComponentTag tag) { tag.put("title", new StringResourceModel(key, base, null).getObject()); } };
@Override public void onComponentTag(final Component component, final ComponentTag tag) { tag.put("title", new StringResourceModel("plugin.display.index.label.title", ResourceBundlePlugin.this, null).getObject()); } })
public ResourceDeleteDialog(final ResourceBundlePlugin plugin, final Resource resource) { this.plugin = plugin; setSize(DialogConstants.MEDIUM_AUTO); // interpolate the string String warning = new StringResourceModel("dialog.resource.delete.warning", plugin, null).getObject(); warning = warning.replaceAll("\\$\\{key\\}", resource.getKey()); add(new Label("warning", warning)); setFocusOnCancel(); }
@Override protected void viewConnObject(final ConnObjectTO connObjectTO, final AjaxRequestTarget target) { anyTypes.setEnabled(false); target.add(anyTypes); connObjects.next( new StringResourceModel("connObject.view", this, new Model<>(connObjectTO)).getObject(), new ConnObjectDetails(connObjectTO), target); }
@Override public void onClick(final AjaxRequestTarget target, final ExecTO ignore) { ExecutionsDirectoryPanel.this.getTogglePanel().close(target); next(new StringResourceModel("execution.view", ExecutionsDirectoryPanel.this, model). getObject(), new ExecMessage(model.getObject().getMessage()), target); } }, ActionLink.ActionType.VIEW, StandardEntitlement.TASK_READ);
void handleException(Exception e, Component target) { Serializable msg = null; if (e instanceof SecurityConfigException) { SecurityConfigException sce = (SecurityConfigException)e; msg = new StringResourceModel("security."+sce.getErrorId(),null,sce.getArgs()).getObject(); } else { msg = e; } (target != null ? target : getPage()).error(msg); }
void handleException(Exception e, Component target) { Serializable msg = null; if (e instanceof SecurityConfigException) { SecurityConfigException sce = (SecurityConfigException)e; msg = new StringResourceModel("security."+sce.getId(),null,sce.getArgs()).getObject(); } else { msg = e; } (target != null ? target : getPage()).error(msg); }
@Override protected void viewMailBody( final MailTemplateFormat format, final String content, final AjaxRequestTarget target) { mlp.next( new StringResourceModel("content", this).setParameters(format.name()).getObject(), new NotificationMailBodyDetails(content), target); }
@Test public void testInvalidateCache() { tester.clickLink("form:invalidate", true); String success = new StringResourceModel(GeofencePage.class.getSimpleName() + ".cacheInvalidated") .getObject(); tester.assertInfoMessages((Serializable[]) new String[] {success}); } }
private void testSuccessfulConnection() throws Exception { authenticate("admin", "admin"); tester.assertNoErrorMessage(); String success = new StringResourceModel( LDAPAuthProviderPanel.class.getSimpleName() + ".connectionSuccessful") .getObject(); tester.assertInfoMessages((Serializable[]) new String[] {success}); }