private String getString(Localizer localizer, String key, Component component) { triedKeys.add(key); return localizer.getString(key, component, ""); }
/** * @param key * The resource key * @param model * The model * @return The formatted string * @see Localizer */ public final String getString(final String key, final IModel<?> model) { return getLocalizer().getString(key, this, model); }
/** * @param key * The resource key * @param model * The model * @return The formatted string * @see Localizer */ public final String getString(final String key, final IModel<?> model) { return getLocalizer().getString(key, this, model); }
private void createNameFieldConfig(final JSONObject fieldConfig) throws JSONException { // render the 'name' column as a link to the template composer String tooltipNamePrefix = getLocalizer().getString("tooltip.name.prefix", this); fieldConfig.put("xtype", "templatecolumn"); fieldConfig.put("tpl", "<a href=\"#\" name=\"show-channel\" title=\"" + tooltipNamePrefix + " {name}\">{name}</a>"); } }
/** * Called when sign in failed */ protected void onSignInFailed() { // Try the component based localizer first. If not found try the // application localizer. Else use the default error(getLocalizer().getString("signInFailed", this, "Sign in failed")); }
@Override public Object getDisplayValue(RoleSource rs) { String key = "RoleSource." + rs.toString(); return Application.get().getResourceSettings().getLocalizer().getString(key, null); }
@Override protected String load() { return Application.get() .getResourceSettings() .getLocalizer() .getString(resourceKey, component, null, null, null, defaultValue); }
@Override public String getObject() { // this shouldn't be called always wrapped! return Application.get() .getResourceSettings() .getLocalizer() .getString(resourceKey, null, null, null, null, defaultValue); }
@Override public String getObject() { // this shouldn't be called always wrapped! return Application.get() .getResourceSettings() .getLocalizer() .getString(resourceKey, null, null, null, null, defaultValue); }
@Override protected String load() { return Application.get() .getResourceSettings() .getLocalizer() .getString(resourceKey, component, null, null, null, defaultValue); }
/** * @see org.apache.wicket.model.AbstractReadOnlyModel#getObject() */ public Object getObject() { return Application.get().getResourceSettings().getLocalizer().getString(resourceKey, component, defaultValue); }
/** * Gets the string the component would use as a label when one was requested but no label model * was set via {@link #getLabel()}. The value of this string is usually set in a property file; * if the value is not set the {@code defaultValue} will be returned. * * @param defaultValue * * @return localized label */ public final String getDefaultLabel(String defaultValue) { return getLocalizer().getString(getId(), getParent(), defaultValue); }
private void reportError(String resourceKey, final String identity) { String message = Application.get().getResourceSettings().getLocalizer().getString(resourceKey, (Component)null, new Model<Serializable>(new Serializable() { @SuppressWarnings("unused") public String getIdentity() { return identity; } })); component.error(AbstractFieldInstancePanel.createErrorMessage(fieldInstanceModel, new Model<String>(message))); }
@Override public void onClick(AjaxRequestTarget target) { try { getGeoServer().reload(); info(getLocalizer().getString("catalogConfigReloadedSuccessfully", StatusPage.this)); } catch(Throwable t) { LOGGER.log(Level.SEVERE, "An error occurred while reloading the catalog", t); error(t); } target.addComponent(feedbackPanel); } });
@Override public String apply(ODocument vertex) { Object fieldIn = getModelObject().field("in"); String direction; if (fieldIn != null) { direction = ((OIdentifiable)fieldIn).getIdentity().equals(vertex.getIdentity()) ? "in":"out"; } else direction = "empty"; return getLocalizer().getString("widget.document.vertices.title." + direction, GraphVerticesWidget.this); }
private String getDisplayName(Class<?> clazz) { String displayName = EditableUtils.getDisplayName(clazz); displayName = Application.get().getResourceSettings().getLocalizer().getString(displayName, this, displayName); return displayName; }
@Override public Object getDisplayValue(T object) { String key = resourcePrefix+"."+(object==null?"null":super.getDisplayValue(object)); return Application.get().getResourceSettings().getLocalizer().getString(key, null); }
@SuppressWarnings("unchecked") private void showChangedPerspectiveInfo() { OrienteerWebSession session = OrienteerWebSession.get(); IModel<ODocument> perspectiveModel = (IModel<ODocument>) session.getAttribute("newPerspective"); if (perspectiveModel != null && perspectiveModel.getObject() != null) { session.setAttribute("newPerspective", null); String msg = getLocalizer().getString("info.perspectivechanged", this, new ODocumentNameModel(perspectiveModel)); info(msg); } }
@Override public void onClick(Optional<AjaxRequestTarget> targetOptional) { ODocument doc = getWidgetDocument(); if(doc.getIdentity().isPersistent()) { setResponsePage(new ODocumentPage(doc)); } else if(targetOptional.isPresent()){ String alert = "alert('"+JavaScriptUtils.escapeQuotes(getLocalizer().getString("warning.widget.nosettings", AbstractWidget.this))+"')"; targetOptional.get().appendJavaScript(alert); } } });
@Override public String getObject() { return RequestCycle.get().getRequest().getRelativePathPrefixToContextRoot() + "doc/" + Application.get().getResourceSettings().getLocalizer().getString(resourceKey, (Component)null, (String)null); } }