本文整理汇总了Java中org.apache.wicket.model.StringResourceModel类的典型用法代码示例。如果您正苦于以下问题:Java StringResourceModel类的具体用法?Java StringResourceModel怎么用?Java StringResourceModel使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
StringResourceModel类属于org.apache.wicket.model包,在下文中一共展示了StringResourceModel类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addExcludesPatternFields
import org.apache.wicket.model.StringResourceModel; //导入依赖的package包/类
private void addExcludesPatternFields(StringResourceModel helpMessage,
final List<CommonPathPattern> includesExcludesSuggestions) {
TextArea excludesTa = new TextArea("excludesPattern");
excludesTa.setEnabled(isSystemAdmin());
excludesTa.setOutputMarkupId(true);
add(excludesTa);
add(new HelpBubble("excludesHelp", helpMessage));
//Excludes suggestions
Model<CommonPathPattern> exclude = new Model<>();
DropDownChoice<CommonPathPattern> excludesSuggest = new DropDownChoice<>(
"excludesSuggest", exclude, includesExcludesSuggestions);
if (!includesExcludesSuggestions.isEmpty()) {
excludesSuggest.setDefaultModelObject(includesExcludesSuggestions.get(0));
}
excludesSuggest.add(new UpdatePatternsBehavior(exclude, excludesTa));
excludesSuggest.setEnabled(isSystemAdmin());
add(excludesSuggest);
}
示例2: getItemDefinitionName
import org.apache.wicket.model.StringResourceModel; //导入依赖的package包/类
private String getItemDefinitionName(ItemDefinition def) {
if (def == null) {
return null;
}
if (def.getDisplayName() != null) {
StringResourceModel nameModel = PageBase.createStringResourceStatic(null, def.getDisplayName());
if (StringUtils.isNotEmpty(nameModel.getString())) {
return nameModel.getString();
}
}
String name = def.getDisplayName(); // TODO this is always null here, isn't it?
if (StringUtils.isEmpty(name)) {
name = def.getName().getLocalPart();
}
return name;
}
示例3: getName
import org.apache.wicket.model.StringResourceModel; //导入依赖的package包/类
public String getName() {
String key = definition.getDisplayName();
if (StringUtils.isEmpty(key)) {
StringBuilder sb = new StringBuilder();
sb.append(search.getType().getSimpleName()).append('.').append(definition.getName().getLocalPart());
key = sb.toString();
}
StringResourceModel nameModel = PageBase.createStringResourceStatic(null, key);
if (nameModel != null){
if (StringUtils.isNotEmpty(nameModel.getString())) {
return nameModel.getString();
}
}
String name = definition.getDisplayName();
if (StringUtils.isNotEmpty(name)) {
return name;
}
return definition.getName().getLocalPart();
}
示例4: initLayout
import org.apache.wicket.model.StringResourceModel; //导入依赖的package包/类
protected void initLayout() {
add(new Label(ID_STATE, new StringResourceModel("ModelOperationStatusPanel.state.${}", new PropertyModel<ModelState>(getModel(), ModelOperationStatusDto.F_STATE))));
// add(new Label(ID_FOCUS_TYPE, new PropertyModel<String>(getModel(), ModelOperationStatusDto.F_FOCUS_TYPE)));
// add(new Label(ID_FOCUS_NAME, new PropertyModel<String>(getModel(), ModelOperationStatusDto.F_FOCUS_NAME)));
ScenePanel deltaPanel = new ScenePanel(ID_PRIMARY_DELTA, new PropertyModel<SceneDto>(getModel(), ModelOperationStatusDto.F_PRIMARY_DELTA));
deltaPanel.add(new VisibleEnableBehaviour() {
@Override
public boolean isVisible() {
return getModelObject() != null && getModelObject().getPrimaryDelta() != null;
}
});
add(deltaPanel);
}
示例5: createStringResource
import org.apache.wicket.model.StringResourceModel; //导入依赖的package包/类
public StringResourceModel createStringResource(Enum e, String prefix, String nullKey) {
StringBuilder sb = new StringBuilder();
if (StringUtils.isNotEmpty(prefix)) {
sb.append(prefix).append('.');
}
if (e == null) {
if (StringUtils.isNotEmpty(nullKey)) {
sb.append(nullKey);
} else {
sb = new StringBuilder();
}
} else {
sb.append(e.getDeclaringClass().getSimpleName()).append('.');
sb.append(e.name());
}
return createStringResource(sb.toString());
}
示例6: getCloseSelectedCampaignsConfirmationPanel
import org.apache.wicket.model.StringResourceModel; //导入依赖的package包/类
private Popupable getCloseSelectedCampaignsConfirmationPanel() {
return new ConfirmationPanel(getMainPopupBodyId(), createCloseSelectedCampaignsConfirmString()) {
private static final long serialVersionUID = 1L;
@Override
public void yesPerformed(AjaxRequestTarget target) {
ModalWindow modalWindow = findParent(ModalWindow.class);
if (modalWindow != null) {
modalWindow.close(target);
closeSelectedCampaignsConfirmedPerformed(target);
}
}
@Override
public StringResourceModel getTitle() {
return createStringResource("PageCertCampaigns.dialog.title.confirmCloseCampaign");
}
};
}
示例7: getDeleteSelectedCampaignsConfirmationPanel
import org.apache.wicket.model.StringResourceModel; //导入依赖的package包/类
private Popupable getDeleteSelectedCampaignsConfirmationPanel() {
return new ConfirmationPanel(getMainPopupBodyId(), createDeleteSelectedCampaignsConfirmString()) {
private static final long serialVersionUID = 1L;
@Override
public void yesPerformed(AjaxRequestTarget target) {
ModalWindow modalWindow = findParent(ModalWindow.class);
if (modalWindow != null) {
modalWindow.close(target);
deleteSelectedCampaignsConfirmedPerformed(target);
}
}
@Override
public StringResourceModel getTitle() {
return createStringResource("PageCertCampaigns.dialog.title.confirmDeleteCampaign");
}
};
}
示例8: getCloseStageConfirmationPanel
import org.apache.wicket.model.StringResourceModel; //导入依赖的package包/类
private Popupable getCloseStageConfirmationPanel() {
return new ConfirmationPanel(getMainPopupBodyId(), createCloseStageConfirmString()) {
private static final long serialVersionUID = 1L;
@Override
public void yesPerformed(AjaxRequestTarget target) {
ModalWindow modalWindow = findParent(ModalWindow.class);
if (modalWindow != null) {
modalWindow.close(target);
closeStageConfirmedPerformed(target, relevantCampaign);
}
}
@Override
public StringResourceModel getTitle() {
return createStringResource("PageCertCampaigns.dialog.title.confirmCloseStage");
}
};
}
示例9: getCloseCampaignConfirmationPanel
import org.apache.wicket.model.StringResourceModel; //导入依赖的package包/类
private Popupable getCloseCampaignConfirmationPanel() {
return new ConfirmationPanel(getMainPopupBodyId(), createCloseCampaignConfirmString()) {
private static final long serialVersionUID = 1L;
@Override
public void yesPerformed(AjaxRequestTarget target) {
ModalWindow modalWindow = findParent(ModalWindow.class);
if (modalWindow != null) {
modalWindow.close(target);
closeCampaignConfirmedPerformed(target, relevantCampaign);
}
}
@Override
public StringResourceModel getTitle() {
return createStringResource("PageCertCampaigns.dialog.title.confirmCloseCampaign");
}
};
}
示例10: getDeleteCampaignConfirmationPanel
import org.apache.wicket.model.StringResourceModel; //导入依赖的package包/类
private Popupable getDeleteCampaignConfirmationPanel() {
return new ConfirmationPanel(getMainPopupBodyId(), createDeleteCampaignConfirmString()) {
private static final long serialVersionUID = 1L;
@Override
public void yesPerformed(AjaxRequestTarget target) {
ModalWindow modalWindow = findParent(ModalWindow.class);
if (modalWindow != null) {
modalWindow.close(target);
deleteCampaignConfirmedPerformed(target);
}
}
@Override
public StringResourceModel getTitle() {
return createStringResource("PageCertCampaigns.dialog.title.confirmDeleteCampaign");
}
};
}
示例11: createPasswordPanel
import org.apache.wicket.model.StringResourceModel; //导入依赖的package包/类
private void createPasswordPanel(WebMarkupContainer staticRegistrationForm) {
// ProtectedStringType initialPassword = null;
PasswordPanel password = new PasswordPanel(ID_PASSWORD,
new PropertyModel<ProtectedStringType>(userModel, "credentials.password.value"), false, true);
password.getBaseFormComponent().add(new EmptyOnBlurAjaxFormUpdatingBehaviour());
password.getBaseFormComponent().setRequired(true);
staticRegistrationForm.add(password);
Label help = new Label(ID_TOOLTIP);
final StringResourceModel tooltipText = createStringResource("PageSelfRegistration.password.policy");
help.add(AttributeModifier.replace("title", tooltipText));
help.add(new InfoTooltipBehavior());
help.add(new VisibleEnableBehaviour() {
private static final long serialVersionUID = 1L;
@Override
public boolean isVisible() {
return StringUtils.isNotEmpty(tooltipText.getObject());
}
});
staticRegistrationForm.add(help);
}
示例12: ThresholdEditor
import org.apache.wicket.model.StringResourceModel; //导入依赖的package包/类
/**
* Threshold editor set values and colors to illustrate intervals of values
*
* @param id
* @param model
*/
public ThresholdEditor(final String id, final IModel<Type> model) {
super(id, model);
// Tooltip config
final TooltipConfig confConfig = new TooltipConfig().withPlacement(TooltipConfig.Placement.top);
// Inicator container
indicatorThreshold = new WebMarkupContainer("indicatorThreshold");
indicatorThreshold.add(new TextField<>("lowerAcceptanceLimit", new PropertyModel<Double>(model, "threshold.lowerAcceptanceLimit")).add(new TooltipBehavior(new StringResourceModel("help.lower.limit", this, model), confConfig)));
indicatorThreshold.add(new TextField<>("upperAcceptanceLimit", new PropertyModel<Double>(model, "threshold.upperAcceptanceLimit")).add(new TooltipBehavior(new StringResourceModel("help.upper.limit", this, model), confConfig)));
// Adding Color indicators
indicatorThreshold.add(choiceColorMenu(model, "threshold.colorLowerAcceptanceLimit"));
indicatorThreshold.add(choiceColorMenu(model, "threshold.colorMiddAcceptanceLimit"));
indicatorThreshold.add(choiceColorMenu(model, "threshold.colorUpperAcceptanceLimit"));
// Adding indicator
indicatorThreshold.setOutputMarkupId(true);
add(indicatorThreshold);
}
示例13: getTooltipModel
import org.apache.wicket.model.StringResourceModel; //导入依赖的package包/类
@Override
public IModel<String> getTooltipModel(final IModel<Object> targetObjectModel) {
return new AbstractReadOnlyModel<String>() {
@Override
public String getObject() {
final String tooltip = getModelElement().getBeanPathElement().getTooltip(targetObjectModel.getObject());
if (tooltip == null) {
return null;
} else {
try {
return new StringResourceModel(tooltip, getContext().getMarkupContainer(),
getContext().getMarkupContainer().getDefaultModel()).setDefaultValue(tooltip)
.getObject();
} catch (final MissingResourceException e) {
return tooltip;
}
}
}
};
}
示例14: addSelectedTeams
import org.apache.wicket.model.StringResourceModel; //导入依赖的package包/类
private void addSelectedTeams(Collection<Team> teams, AjaxRequestTarget target, Collection<Project> allProjects) {
String message = new StringResourceModel("add.confirmed", this, null).getString();
for (Team team : teams) {
if (project != null) {
if (!project.getTeams().contains(team)) {
project.getTeams().add(team);
}
}
teamService.update(team);
projectService.update(project);
}
getPage().success(message);
target.add(feedbackPanel);
target.add(teamsContainer);
teamGroup.updateModel();
target.add(addSelectedButton);
}
示例15: SakaiNavigatorLabel
import org.apache.wicket.model.StringResourceModel; //导入依赖的package包/类
private SakaiNavigatorLabel(final String id, final PageableComponent table) {
super(id);
Model model = new Model(new LabelModelObject(table));
setDefaultModel(
new StringResourceModel(
"pager_textStatus",
this,
model,
"Viewing {0} - {1} of {2} {3}",
new Object[] {
new PropertyModel(model, "from"),
new PropertyModel(model, "to"),
new PropertyModel(model, "of"),
new ResourceModel("pager_textItem"),
})
);
}