当前位置: 首页>>代码示例>>Java>>正文


Java StringResourceModel类代码示例

本文整理汇总了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);
}
 
开发者ID:alancnet,项目名称:artifactory,代码行数:21,代码来源:RepositoriesTabPanel.java

示例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;
  }
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:18,代码来源:Property.java

示例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();
}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:22,代码来源:SearchItem.java

示例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);

    }
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:18,代码来源:ModelOperationStatusPanel.java

示例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());
}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:20,代码来源:WizardStep.java

示例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");
		}
	};
}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:20,代码来源:PageCertCampaigns.java

示例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");
		}
	};
}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:19,代码来源:PageCertCampaigns.java

示例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");
		}
	};
}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:19,代码来源:PageCertCampaigns.java

示例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");
		}
	};
}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:19,代码来源:PageCertCampaigns.java

示例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");
		}
	};
}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:19,代码来源:PageCertCampaigns.java

示例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);
}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:24,代码来源:PageSelfRegistration.java

示例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);
	
}
 
开发者ID:U-QASAR,项目名称:u-qasar.platform,代码行数:29,代码来源:ThresholdEditor.java

示例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;
                }
            }
        }
    };
}
 
开发者ID:subes,项目名称:invesdwin-nowicket,代码行数:21,代码来源:AModelHtmlElement.java

示例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);
}
 
开发者ID:U-QASAR,项目名称:u-qasar.platform,代码行数:20,代码来源:TeamListPage.java

示例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"),
					})
	);
}
 
开发者ID:sakaiproject,项目名称:sakai,代码行数:18,代码来源:SakaiNavigatorLabel.java


注:本文中的org.apache.wicket.model.StringResourceModel类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。