本文整理汇总了Java中org.apache.wicket.model.ResourceModel类的典型用法代码示例。如果您正苦于以下问题:Java ResourceModel类的具体用法?Java ResourceModel怎么用?Java ResourceModel使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ResourceModel类属于org.apache.wicket.model包,在下文中一共展示了ResourceModel类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addUserMenu
import org.apache.wicket.model.ResourceModel; //导入依赖的package包/类
protected Component addUserMenu() {
DropDownButton userMenu = new NavbarDropDownButton(Model.of("Username")) {
/**
*
*/
private static final long serialVersionUID = 1L;
@Override
protected List<AbstractLink> newSubMenuButtons(final String buttonMarkupId) {
List<AbstractLink> subMenu = Lists.newArrayList();
subMenu.add(new MenuBookmarkablePageLink<Void>(UserSettingsPage.class,
new ResourceModel("navbar.userMenu.settings"))
.setIconType(FontAwesomeIconType.gear));
subMenu.add(new MenuDivider());
subMenu.add(new MenuBookmarkablePageLink<Void>(LogOutPage.class,
new ResourceModel("navbar.userMenu.logout"))
.setIconType(FontAwesomeIconType.power_off));
return subMenu;
}
}.setIconType(FontAwesomeIconType.user);
return userMenu;
}
示例2: createCapabilityButton
import org.apache.wicket.model.ResourceModel; //导入依赖的package包/类
private void createCapabilityButton(String id) {
AjaxLink<Boolean> button = new AjaxLink<Boolean>(id, new PropertyModel<Boolean>(getModel(), id)) {
@Override
public void onClick(AjaxRequestTarget target) {
// TODO:
}
};
button.add(new AttributeModifier("class",
button.getModelObject() ? "btn btn-app btn-resource-capability bg-light-blue"
: "btn btn-app btn-resource-capability bg-gray text-light-blue"));
button.add(new Label("label", new ResourceModel("CapabilitiesType." + id)));
add(button);
}
示例3: createRemovePictureButton
import org.apache.wicket.model.ResourceModel; //导入依赖的package包/类
private AjaxFallbackButton createRemovePictureButton(Form imageEditForm) {
AjaxFallbackButton removePictureButton = new AjaxFallbackButton(
"galleryImageRemoveButton", new ResourceModel(
"button.gallery.remove"), imageEditForm) {
@Override
protected void onSubmit(AjaxRequestTarget target, Form form) {
imageOptionsContainer.setVisible(false);
target.appendJavaScript("$('#"
+ imageOptionsContainer.getMarkupId() + "').hide();");
removeConfirmContainer.setVisible(true);
target.add(removeConfirmContainer);
target.appendJavaScript("setMainFrameHeight(window.name);");
}
};
return removePictureButton;
}
示例4: UserSearchPanel
import org.apache.wicket.model.ResourceModel; //导入依赖的package包/类
public UserSearchPanel(String id, IPageable pageable, UserTypeDescriptor<U> typeDescriptor,
AbstractUserDataProvider<U> dataProvider) {
super(id);
// Quick search
UserQuickSearchComponent<?> userQuickSearch = new UserQuickSearchComponent<>("userQuickSearch", typeDescriptor);
userQuickSearch.setAutoUpdate(true);
userQuickSearch.getAutocompleteField().setLabel(new ResourceModel("common.quickAccess"));
userQuickSearch.getAutocompleteField().add(new LabelPlaceholderBehavior());
add(userQuickSearch);
// Search form
add(
new PageableSearchForm<Void>("form", pageable)
.add(
new TextField<String>("searchInput", dataProvider.getNameModel())
.setLabel(new ResourceModel("administration.user.search.name"))
.add(new LabelPlaceholderBehavior()),
new UserGroupDropDownSingleChoice("userGroup", dataProvider.getGroupModel())
.setLabel(new ResourceModel("administration.user.search.group"))
.add(new LabelPlaceholderBehavior()),
new CheckBox("active", dataProvider.getIncludeInactivesModel())
.setLabel(new ResourceModel("administration.user.search.includeInactives"))
)
);
}
示例5: AssociationTransformFunctionBoxPanel
import org.apache.wicket.model.ResourceModel; //导入依赖的package包/类
public AssociationTransformFunctionBoxPanel(String id, final TopicModel<Topic> topicModel) {
super(id);
add(new Label("title", new ResourceModel("transform.association.instances")));
Button addButton = new Button("button", new ResourceModel("transform"));
addButton.add(new AjaxFormComponentUpdatingBehavior("onclick") {
@Override
protected void onUpdate(AjaxRequestTarget target) {
Topic instance = topicModel.getTopic();
Map<String,String> pageParametersMap = new HashMap<String,String>();
pageParametersMap.put("topicMapId", instance.getTopicMap().getId());
pageParametersMap.put("topicId", instance.getId());
setResponsePage(AssociationTransformPage.class, new PageParameters(pageParametersMap));
}
});
add(addButton);
}
示例6: ApplicationAccessTemplate
import org.apache.wicket.model.ResourceModel; //导入依赖的package包/类
public ApplicationAccessTemplate(PageParameters parameters) {
super(parameters);
if (Boolean.TRUE.equals(propertyService.get(MAINTENANCE)) && !authenticationService.hasAdminRole()
&& hasMaintenanceRestriction()) {
throw new RedirectToUrlException(propertyService.get(MAINTENANCE_URL));
}
add(new EnvironmentPanel("environment"));
add(new AnimatedGlobalFeedbackPanel("feedback"));
add(new TransparentWebMarkupContainer("htmlRootElement")
.add(AttributeAppender.append("lang", BasicApplicationSession.get().getLocale().getLanguage())));
addHeadPageTitlePrependedElement(new BreadCrumbElement(new ResourceModel("common.rootPageTitle")));
add(createHeadPageTitle("headPageTitle"));
add(new CoreLabel("title", getTitleModel()));
}
示例7: LabelTextFieldRow
import org.apache.wicket.model.ResourceModel; //导入依赖的package包/类
public LabelTextFieldRow(String aId, IModel<T> aModel, String aResourceKey, boolean aRequired) {
super(aId);
// row
WebMarkupContainer row = new WebMarkupContainer("row");
row.add(new AttributeAppender("class", new Model<String>(aRequired ? "required" : ""), " " ));
add(row);
// label
Label label = new Label("label-id", new ResourceModel(aResourceKey));
label.add(new AttributeModifier("for", new Model<String>(aId)));
row.add(label);
// field
row.add(textField = new LabeledRequiredTextField<T>("field-id", aModel, aId, aResourceKey, aRequired));
}
示例8: initComponentsApplicationSelect
import org.apache.wicket.model.ResourceModel; //导入依赖的package包/类
private void initComponentsApplicationSelect(WebMarkupContainer selectApplicationContainer) {
List<Application> appList = new ArrayList<>();
if (showApplicationSelection) {
if (app == null) {
appList = (List<Application>) manageApplication.findMyApplications();
} else {
appList = Arrays.asList(app);
}
}
ChoiceRenderer<Application> choiceRenderer = new ChoiceRenderer<Application>("label", "uid");
applicationDropDownChoice = new DropDownChoice<Application>("application", appList, choiceRenderer);
if (app != null) {
applicationDropDownChoice.setEnabled(false);
}
// app required
applicationDropDownChoice.setRequired(true);
applicationDropDownChoice.add(new PropertyValidator<>());
selectApplicationContainer.add(applicationDropDownChoice);
selectApplicationContainer.add(new CacheActivatedImage("applicationHelp",new ResourceModel("image.help").getObject()));
}
示例9: LabelPasswordTextFieldRow
import org.apache.wicket.model.ResourceModel; //导入依赖的package包/类
public LabelPasswordTextFieldRow(String aId, IModel<String> aModel, String aResourceKey, boolean aRequired) {
super(aId);
// row
WebMarkupContainer row = new WebMarkupContainer("row");
row.add(new AttributeAppender("class", new Model<String>(aRequired ? "required" : ""), " "));
add(row);
// label
Label label = new Label("label-id", new ResourceModel(aResourceKey));
label.add(new AttributeModifier("for", new Model<String>(aId)));
row.add(label);
// field
row.add(passwordTextField = new LabeledRequiredTextField("field-id", aModel, aId, aResourceKey, aRequired));
}
示例10: createSetProfileImageButton
import org.apache.wicket.model.ResourceModel; //导入依赖的package包/类
private AjaxFallbackButton createSetProfileImageButton(Form imageEditForm) {
AjaxFallbackButton setProfileImageButton = new AjaxFallbackButton(
"gallerySetProfileImageButton", new ResourceModel(
"button.gallery.setprofile"), imageEditForm) {
@Override
protected void onSubmit(AjaxRequestTarget target, Form form) {
imageOptionsContainer.setVisible(false);
target.appendJavaScript("$('#"
+ imageOptionsContainer.getMarkupId() + "').hide();");
setProfileImageConfirmContainer.setVisible(true);
target.add(setProfileImageConfirmContainer);
target.appendJavaScript("setMainFrameHeight(window.name);");
}
};
return setProfileImageButton;
}
示例11: renderImage
import org.apache.wicket.model.ResourceModel; //导入依赖的package包/类
public Image renderImage(AjaxRequestTarget target, boolean fullRender) {
if(returnPage != null || returnClass != null) {
link.add(new AttributeModifier("title", new ResourceModel("click_to_max")));
link.setEnabled(true);
}
link.removeAll();
Image img = null;
if(!autoDetermineChartSizeByAjax) {
img = createImage("content", getImageData());
}else{
img = createImage("content", getImageData(selectedWidth, selectedHeight));
}
img.add(AttributeModifier.replace("style", "display: none; margin: 0 auto;"));
link.add(img);
setState((byte) 1);
if(fullRender) {
if(target != null) {
target.add(link);
target.appendJavaScript("jQuery('#"+img.getMarkupId()+"').fadeIn();");
}
setState((byte) 2);
}
return img;
}
示例12: createSetProfileImageCancelButton
import org.apache.wicket.model.ResourceModel; //导入依赖的package包/类
private AjaxFallbackButton createSetProfileImageCancelButton(Form imageEditForm) {
AjaxFallbackButton removeCancelButton = new AjaxFallbackButton(
"gallerySetProfileImageCancelButton", new ResourceModel(
"button.cancel"), imageEditForm) {
@Override
protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
target.appendJavaScript("$('#"
+ setProfileImageConfirmContainer.getMarkupId() + "').hide();");
imageOptionsContainer.setVisible(true);
target.add(imageOptionsContainer);
target.appendJavaScript("setMainFrameHeight(window.name);");
}
};
return removeCancelButton;
}
示例13: createBody
import org.apache.wicket.model.ResourceModel; //导入依赖的package包/类
@Override
protected Component createBody(String wicketId) {
DelegatedMarkupPanel body = new DelegatedMarkupPanel(wicketId, AddUserPopupPanel.class);
addUserForm = new Form<User>("addUserForm", getModel());
body.add(addUserForm);
TextField<String> userName = new RequiredTextField<String>("userName", BindingModel.of(addUserForm.getModel(), Bindings.user().userName()));
userName.setLabel(new ResourceModel("widgets.modal.user.userName"));
addUserForm.add(userName);
TextField<String> firstName = new RequiredTextField<String>("firstName", BindingModel.of(addUserForm.getModel(), Bindings.user().firstName()));
firstName.setLabel(new ResourceModel("widgets.modal.user.firstName"));
addUserForm.add(firstName);
TextField<String> lastName = new RequiredTextField<String>("lastName", BindingModel.of(addUserForm.getModel(), Bindings.user().lastName()));
lastName.setLabel(new ResourceModel("widgets.modal.user.lastName"));
addUserForm.add(lastName);
EmailTextField email = new EmailTextField("email", BindingModel.of(addUserForm.getModel(), Bindings.user().email()));
email.setRequired(true);
email.setLabel(new ResourceModel("widgets.modal.user.email"));
addUserForm.add(email);
return body;
}
示例14: AutosizePage
import org.apache.wicket.model.ResourceModel; //导入依赖的package包/类
public AutosizePage(PageParameters parameters) {
super(parameters);
addBreadCrumbElement(new BreadCrumbElement(new ResourceModel("widgets.menu.autosize"), AutosizePage.linkDescriptor()));
TextArea<String> defaultBehavior = new TextArea<String>("defaultBehavior");
defaultBehavior.add(new AutosizeBehavior());
add(defaultBehavior);
TextArea<String> withMaxHeight = new TextArea<String>("withMaxHeight");
withMaxHeight.add(new AutosizeBehavior());
add(withMaxHeight);
MultiLineLabel multiLineLabel = new MultiLineLabel("multiLineLabel", new ResourceModel("widgets.autosize.more.text"));
multiLineLabel.add(new MoreBehavior());
add(multiLineLabel);
}
示例15: addPathField
import org.apache.wicket.model.ResourceModel; //导入依赖的package包/类
private void addPathField() {
pathField = new RepoPathAutoCompleteTextField("targetPath", repoService) {
@Override
public boolean isEnabled() {
return !model.isMavenArtifact;
}
};
pathField.setRepoKey(((LocalRepoDescriptor) targetRepo.getDefaultModelObject()).getKey());
pathField.getDefaultModel();
pathField.setRequired(true);
pathField.setOutputMarkupId(true);
pathField.add(new DeployTargetPathValidator());
add(pathField);
add(new HelpBubble("targetPath.help", new ResourceModel("targetPath.help")));
}