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


Java ResourceModel类代码示例

本文整理汇总了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;
}
 
开发者ID:jorcox,项目名称:GeoCrawler,代码行数:23,代码来源:AbstractBasePage.java

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

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

示例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"))
					)
	);
}
 
开发者ID:openwide-java,项目名称:owsi-core-parent,代码行数:27,代码来源:UserSearchPanel.java

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

示例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()));
}
 
开发者ID:openwide-java,项目名称:owsi-core-parent,代码行数:21,代码来源:ApplicationAccessTemplate.java

示例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));
}
 
开发者ID:payneteasy,项目名称:superfly,代码行数:17,代码来源:LabelTextFieldRow.java

示例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()));
}
 
开发者ID:orange-cloudfoundry,项目名称:elpaaso-core,代码行数:24,代码来源:ReleaseFieldsetPanel.java

示例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));
}
 
开发者ID:payneteasy,项目名称:superfly,代码行数:17,代码来源:LabelPasswordTextFieldRow.java

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

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

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

示例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;
}
 
开发者ID:openwide-java,项目名称:owsi-core-parent,代码行数:27,代码来源:AddUserPopupPanel.java

示例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);
}
 
开发者ID:openwide-java,项目名称:owsi-core-parent,代码行数:18,代码来源:AutosizePage.java

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


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