本文整理汇总了Java中org.apache.wicket.markup.html.image.ContextImage类的典型用法代码示例。如果您正苦于以下问题:Java ContextImage类的具体用法?Java ContextImage怎么用?Java ContextImage使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ContextImage类属于org.apache.wicket.markup.html.image包,在下文中一共展示了ContextImage类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: KudosPanel
import org.apache.wicket.markup.html.image.ContextImage; //导入依赖的package包/类
public KudosPanel(String id, final String ownerUserId, final String viewingUserId, final int score) {
super(id);
log.debug("KudosPanel()");
//heading
Label heading = new Label("heading");
if(viewingUserId.equals(ownerUserId)) {
heading.setDefaultModel(new ResourceModel("heading.widget.my.kudos"));
} else {
String displayName = sakaiProxy.getUserDisplayName(ownerUserId);
heading.setDefaultModel(new StringResourceModel("heading.widget.view.kudos", null, new Object[]{ displayName } ));
}
add(heading);
//score
add(new Label("kudosRating", String.valueOf(score)));
String img = getImage(score);
//images
add(new ContextImage("kudosImgLeft", img));
add(new ContextImage("kudosImgRight", img));
}
开发者ID:sakaiproject,项目名称:sakai,代码行数:27,代码来源:KudosPanel.java
示例2: getPullStatusImage
import org.apache.wicket.markup.html.image.ContextImage; //导入依赖的package包/类
public static ContextImage getPullStatusImage(String wicketId, FederationPullStatus status) {
String filename = null;
switch (status) {
case MIRRORED:
case PULLED:
filename = "bullet_green.png";
break;
case SKIPPED:
filename = "bullet_yellow.png";
break;
case FAILED:
filename = "bullet_red.png";
break;
case EXCLUDED:
filename = "bullet_white.png";
break;
case PENDING:
case NOCHANGE:
default:
filename = "bullet_black.png";
}
return WicketUtils.newImage(wicketId, filename, status.name());
}
开发者ID:warpfork,项目名称:gitblit,代码行数:24,代码来源:WicketUtils.java
示例3: RunHistoryDetailPanel
import org.apache.wicket.markup.html.image.ContextImage; //导入依赖的package包/类
public RunHistoryDetailPanel(String id, final RunReportHistory runHistory) {
super(id);
add(new ContextImage("image", new LoadableDetachableModel<String>() {
@Override
protected String load() {
String theme = settings.getSettings().getColorTheme();
return runHistory.isSuccess() ? "images/" + ThemesManager.getTickImage(theme, (NextServerApplication)getApplication()) : "images/delete.gif";
}
}));
add(new Label("messageTitle", new Model<String>(getString("ActionContributor.RunHistory.message"))));
add(new MultiLineLabel("messageContent", new Model<String>(runHistory.getMessage())));
add(new Label("valuesTitle", new Model<String>(getString("ActionContributor.RunHistory.runtime"))));
String values = ReportUtil.getDebugParameters(runHistory.getParametersValues(), runHistory.getParametersDisplayNames());
//values = values.replaceAll("\r\n", "<br>");
add(new MultiLineLabel("valuesContent", new Model<String>(values)));
}
开发者ID:nextreports,项目名称:nextreports-server,代码行数:23,代码来源:RunHistoryDetailPanel.java
示例4: addComponents
import org.apache.wicket.markup.html.image.ContextImage; //导入依赖的package包/类
@Override
protected void addComponents(Form<Settings> form) {
final TextField<String> cronField = new TextField<String>("synchronizer.cronExpression");
cronField.setRequired(true);
form.add(cronField);
ContextImage cronImage = new ContextImage("cronImage","images/information.png");
cronImage.add(new SimpleTooltipBehavior(getString("Settings.synchronizer.cronTooltip")));
form.add(cronImage);
final CheckBox checkBoxD = new CheckBox("synchronizer.runOnStartup");
form.add(checkBoxD);
final CheckBox checkBoxW = new CheckBox("synchronizer.createUsers");
form.add(checkBoxW);
final CheckBox checkBoxR = new CheckBox("synchronizer.deleteUsers");
form.add(checkBoxR);
oldCronExpression = String.valueOf(storageService.getSettings().getSynchronizer().getCronExpression());
}
开发者ID:nextreports,项目名称:nextreports-server,代码行数:22,代码来源:SynchronizerSettingsPanel.java
示例5: addComponents
import org.apache.wicket.markup.html.image.ContextImage; //导入依赖的package包/类
@Override
protected void addComponents(Form<Settings> form) {
final TextField<String> cronField = new TextField<String>("cleanHistory.cronExpression");
cronField.setRequired(true);
form.add(cronField);
//
ContextImage cronImage = new ContextImage("cronImage", "images/information.png");
cronImage.add(new SimpleTooltipBehavior(getString("Settings.synchronizer.cronTooltip")));
form.add(cronImage);
//
System.out.println("settings = " + form.getModelObject());
final TextField<Integer> daysToKeepField = new TextField<Integer>("cleanHistory.daysToKeep");
form.add(daysToKeepField);
//
final TextField<Integer> daysToDeleteField = new TextField<Integer>("cleanHistory.daysToDelete");
form.add(daysToDeleteField);
//
final CheckBox checkBoxEnable = new CheckBox("cleanHistory.shrinkDataFolder");
form.add(checkBoxEnable);
//
CleanHistorySettings settings = storageService.getSettings().getCleanHistory();
oldCronExpression = String.valueOf(settings.getCronExpression());
}
开发者ID:nextreports,项目名称:nextreports-server,代码行数:24,代码来源:CleanHistorySettingsPanel.java
示例6: IconWithClueTip
import org.apache.wicket.markup.html.image.ContextImage; //导入依赖的package包/类
public IconWithClueTip(String id, String iconUrl, IModel textModel) {
super(id);
//tooltip text
Label text = new Label("text", textModel);
text.setOutputMarkupId(true);
add(text);
//we need to id of the text span so that we can map it to the link.
//the cluetip functions automatically hide it for us.
StringBuilder textId = new StringBuilder();
textId.append("#");
textId.append(text.getMarkupId());
//link
AjaxFallbackLink link = new AjaxFallbackLink("link") {
public void onClick(AjaxRequestTarget target) {
//nothing
}
};
link.add(new AttributeModifier("rel", true, new Model(textId)));
link.add(new AttributeModifier("href", true, new Model(textId)));
//image
ContextImage image = new ContextImage("icon",new Model(iconUrl));
link.add(image);
add(link);
}
开发者ID:sakaiproject,项目名称:sakai,代码行数:31,代码来源:IconWithClueTip.java
示例7: GalleryImageRenderer
import org.apache.wicket.markup.html.image.ContextImage; //导入依赖的package包/类
/**
* Creates a new instance of <code>GalleryImageRenderer</code>.
*/
public GalleryImageRenderer(String id, String imageResourceId) {
super(id);
if (imageResourceId == null) {
add(new ContextImage("img",new Model(ProfileConstants.UNAVAILABLE_IMAGE)));
return;
}
else if (sakaiProxy.getResource(imageResourceId) == null) {
// may have been deleted in CHS
add(new ContextImage("img",new Model(ProfileConstants.UNAVAILABLE_IMAGE)));
return;
}
final byte[] imageBytes = sakaiProxy.getResource(imageResourceId).getBytes();
if (imageBytes != null && imageBytes.length > 0) {
BufferedDynamicImageResource imageResource = new BufferedDynamicImageResource() {
private static final long serialVersionUID = 1L;
@Override
protected byte[] getImageData(IResource.Attributes ignored) {
return imageBytes;
}
};
Image myPic = new Image("img", new Model(imageResource));
myPic.add(new AttributeModifier("alt", new StringResourceModel("profile.gallery.image.alt",this,null).getString()));
add(myPic);
} else {
add(new ContextImage("img",new Model(ProfileConstants.UNAVAILABLE_IMAGE)));
}
}
开发者ID:sakaiproject,项目名称:sakai,代码行数:38,代码来源:GalleryImageRenderer.java
示例8: getRegistrationImage
import org.apache.wicket.markup.html.image.ContextImage; //导入依赖的package包/类
public static ContextImage getRegistrationImage(String wicketId, FederationModel registration,
Component c) {
if (registration.isResultData()) {
return WicketUtils.newImage(wicketId, "information_16x16.png",
c.getString("gb.federationResults"));
} else {
return WicketUtils.newImage(wicketId, "arrow_left.png",
c.getString("gb.federationRegistration"));
}
}
开发者ID:warpfork,项目名称:gitblit,代码行数:11,代码来源:WicketUtils.java
示例9: newImage
import org.apache.wicket.markup.html.image.ContextImage; //导入依赖的package包/类
public static ContextImage newImage(String wicketId, String file, String tooltip) {
ContextImage img = new ContextImage(wicketId, file);
if (!StringUtils.isEmpty(tooltip)) {
setHtmlTooltip(img, tooltip);
}
return img;
}
开发者ID:warpfork,项目名称:gitblit,代码行数:8,代码来源:WicketUtils.java
示例10: getCurrentFolderImage
import org.apache.wicket.markup.html.image.ContextImage; //导入依赖的package包/类
public static ContextImage getCurrentFolderImage(final Response response, final AbstractLink folderLink, final TreeTableNode node)
{
final ContextImage folderImage = (ContextImage) folderLink.get("folderImage");
final ContextImage folderOpenImage = (ContextImage) folderLink.get("folderOpenImage");
final boolean isOpen = node.isOpened();
folderImage.setVisible(!isOpen);
folderOpenImage.setVisible(isOpen);
if (isOpen == true) {
return folderOpenImage;
} else {
return folderImage;
}
}
开发者ID:micromata,项目名称:projectforge-webapp,代码行数:14,代码来源:TreeIconsActionPanel.java
示例11: getInvisibleDummyImage
import org.apache.wicket.markup.html.image.ContextImage; //导入依赖的package包/类
/**
*
* @return
*/
public static ContextImage getInvisibleDummyImage(final String id, final RequestCycle requestCylce)
{
final ContextImage image = new ContextImage(id, WicketUtils.getImageUrl(requestCylce, WebConstants.IMAGE_SPACER));
image.setVisible(false);
return image;
}
开发者ID:micromata,项目名称:projectforge-webapp,代码行数:11,代码来源:WicketUtils.java
示例12: getImage
import org.apache.wicket.markup.html.image.ContextImage; //导入依赖的package包/类
protected Component getImage() {
return new ContextImage("image", new LoadableDetachableModel<String>() {
@Override
protected String load() {
return getImageName();
}
});
}
开发者ID:nextreports,项目名称:nextreports-server,代码行数:9,代码来源:AbstractImageAjaxLinkPanel.java
示例13: LinkImageTextFragment
import org.apache.wicket.markup.html.image.ContextImage; //导入依赖的package包/类
public LinkImageTextFragment(AbstractLink link, String image, String label) {
super("linkFragment", decorateMarkupId("LINK_IMAGE_TEXT_FRAGMENT", image), MenuPanel.this);
setRenderBodyOnly(true);
if (isFontawesome(image)) {
link.add(new TransparentWebMarkupContainer(LINK_IMAGE_ID).add(AttributeModifier.append("class", "fa-" + image)));
} else {
link.add(new ContextImage(LINK_IMAGE_ID, image));
}
link.add(new SimpleTooltipBehavior(label));
link.add(new Label(LINK_TEXT_ID, label));
add(link);
}
开发者ID:nextreports,项目名称:nextreports-server,代码行数:14,代码来源:MenuPanel.java
示例14: LinkImageFragment
import org.apache.wicket.markup.html.image.ContextImage; //导入依赖的package包/类
public LinkImageFragment(AbstractLink link, String image) {
super("linkFragment", decorateMarkupId("LINK_IMAGE_FRAGMENT", image), MenuPanel.this);
setRenderBodyOnly(true);
if (isFontawesome(image)) {
link.add(new TransparentWebMarkupContainer(LINK_IMAGE_ID).add(AttributeModifier.append("class", "fa-" + image)));
} else {
link.add(new ContextImage(LINK_IMAGE_ID, image));
}
add(link);
}
开发者ID:nextreports,项目名称:nextreports-server,代码行数:12,代码来源:MenuPanel.java
示例15: ImageFragment
import org.apache.wicket.markup.html.image.ContextImage; //导入依赖的package包/类
public ImageFragment(String image) {
super("linkFragment", decorateMarkupId("IMAGE_FRAGMENT", image), MenuPanel.this);
setRenderBodyOnly(true);
if (isFontawesome(image)) {
add(new TransparentWebMarkupContainer(LINK_IMAGE_ID).add(AttributeModifier.append("class", "fa-" + image)));
} else {
add(new ContextImage(LINK_IMAGE_ID, image));
}
}
开发者ID:nextreports,项目名称:nextreports-server,代码行数:11,代码来源:MenuPanel.java
示例16: ImageCarouselPanel
import org.apache.wicket.markup.html.image.ContextImage; //导入依赖的package包/类
public ImageCarouselPanel(String id, String diaporamaId) {
super(id);
this.diaporamaId = diaporamaId;
final MarkupContainer diaporamaContainer = new WebMarkupContainer("container");
diaporamaContainer.setOutputMarkupId(true);
add(diaporamaContainer);
List<DummyImageBean> imageBeans = Lists.newArrayList(
new DummyImageBean("logo_openwide.png", "widgets.carousel.openwide.header", "widgets.carousel.openwide.footer"),
new DummyImageBean("logo_sitra.jpg", "widgets.carousel.sitra.header", "widgets.carousel.sitra.footer"),
new DummyImageBean("logo_sytral.jpg", "widgets.carousel.sytral.header", "widgets.carousel.sytral.footer"),
new DummyImageBean("logo_vuitton.jpg", "widgets.carousel.vuitton.header", "widgets.carousel.vuitton.footer")
);
diaporamaContainer.add(new ListView<DummyImageBean>("imageItem", imageBeans) {
private static final long serialVersionUID = 4148116695921332880L;
@Override
protected void populateItem(ListItem<DummyImageBean> item) {
DummyImageBean imageBean = item.getModelObject();
Component header = new Label("header", new ResourceModel(imageBean.getHeaderLabelKey()));
header.setOutputMarkupId(true);
item.add(header);
WebMarkupContainer footer = new WebMarkupContainer("footer");
footer.add(new Label("footerLabel", new ResourceModel(imageBean.getFooterLabelKey())));
footer.setOutputMarkupId(true);
item.add(footer);
WebComponent image = new ContextImage("image", CONTEXT_RELATIVE_IMAGES_PATH + imageBean.getImagePath());
AbstractLink imageLink = new ResourceLink<Void>("imageLink",
new PackageResourceReference(MainTemplate.class, "images/" + imageBean.getImagePath()));
imageLink.add(new AttributeModifier("rel", ImageCarouselPanel.this.diaporamaId));
imageLink.add(new ModalHeaderFooterBehavior(header, footer));
imageLink.add(image);
item.add(imageLink);
}
});
final Component nextButton = new WebMarkupContainer("nextButton");
nextButton.setOutputMarkupId(true);
add(nextButton);
final Component prevButton = new WebMarkupContainer("prevButton");
prevButton.setOutputMarkupId(true);
add(prevButton);
diaporamaContainer.add(new CarouFredSelBehavior(getCarouFredSel(prevButton, nextButton)));
diaporamaContainer.add(new ModalDiaporamaBehavior("a[rel=" + ImageCarouselPanel.this.diaporamaId +"]", new Modal()));
}
开发者ID:openwide-java,项目名称:owsi-core-parent,代码行数:54,代码来源:ImageCarouselPanel.java
示例17: linkedFragment
import org.apache.wicket.markup.html.image.ContextImage; //导入依赖的package包/类
/**
* Fragment which returns the components for the linked view
* @return
*/
private Fragment linkedFragment() {
Fragment frag = new Fragment("fragmentContainer", "linked", this);
//label
frag.add(new Label("twitterAuthLabel", new ResourceModel("twitter.auth.linked")));
//screen name
String twitterName = externalIntegrationLogic.getTwitterName(externalIntegrationInfo);
Label twitterAuthName = new Label("twitterAuthName", new Model<String>(twitterName));
if(StringUtils.isBlank(twitterName)){
twitterAuthName.setDefaultModel(new ResourceModel("error.twitter.details.invalid"));
}
frag.add(twitterAuthName);
//remove link
IndicatingAjaxLink<String> twitterAuthRemoveLink = new IndicatingAjaxLink<String>("twitterAuthRemoveLink") {
private static final long serialVersionUID = 1L;
public void onClick(AjaxRequestTarget target) {
externalIntegrationInfo.setTwitterToken(null);
externalIntegrationInfo.setTwitterSecret(null);
//remove details
if(externalIntegrationLogic.updateExternalIntegrationInfo(externalIntegrationInfo)) {
switchContentFragments(unlinkedFragment(), target);
} else {
target.appendJavaScript("alert('Couldn't remove info');");
return;
}
}
};
ContextImage twitterAuthRemoveIcon = new ContextImage("twitterAuthRemoveIcon",new Model<String>(ProfileConstants.CROSS_IMG));
twitterAuthRemoveLink.add(twitterAuthRemoveIcon);
twitterAuthRemoveLink.add(new AttributeModifier("title", true,new ResourceModel("link.title.unlinktwitter")));
frag.add(twitterAuthRemoveLink);
frag.setOutputMarkupId(true);
return frag;
}
开发者ID:sakaiproject,项目名称:sakai,代码行数:48,代码来源:TwitterPrefsPane.java
示例18: OnlinePresenceIndicator
import org.apache.wicket.markup.html.image.ContextImage; //导入依赖的package包/类
public OnlinePresenceIndicator(String id, String userUuid) {
super(id);
//get user's firstname
String firstname = sakaiProxy.getUserFirstName(userUuid);
if(StringUtils.isBlank(firstname)){
firstname = new StringResourceModel("profile.name.first.none", null).getString();
}
//get user's online status
int status = connectionsLogic.getOnlineStatus(userUuid);
//get the mapping
Map<String,String> m = mapStatus(status);
//tooltip text
Label text = new Label("text", new StringResourceModel(m.get("text"), null, new Object[]{ firstname } ));
text.setOutputMarkupId(true);
add(text);
//we need to id of the text span so that we can map it to the link.
//the cluetip functions automatically hide it for us.
StringBuilder textId = new StringBuilder();
textId.append("#");
textId.append(text.getMarkupId());
//link
AjaxFallbackLink link = new AjaxFallbackLink("link") {
public void onClick(AjaxRequestTarget target) {
//nothing
}
};
link.add(new AttributeModifier("rel", true, new Model(textId)));
link.add(new AttributeModifier("href", true, new Model(textId)));
//image
ContextImage image = new ContextImage("icon",new Model(m.get("url")));
link.add(image);
add(link);
}
开发者ID:sakaiproject,项目名称:sakai,代码行数:43,代码来源:OnlinePresenceIndicator.java
示例19: AboutPage
import org.apache.wicket.markup.html.image.ContextImage; //导入依赖的package包/类
public AboutPage(final PageParameters parameters) {
super(parameters);
add(new ContextImage("dashimg", "assets/img/screenshot/dash.png"));
}
开发者ID:U-QASAR,项目名称:u-qasar.platform,代码行数:6,代码来源:AboutPage.java
示例20: WidgetHeaderPanel
import org.apache.wicket.markup.html.image.ContextImage; //导入依赖的package包/类
public WidgetHeaderPanel(String id, IModel<Widget> model) {
super(id, model);
setMarkupId("header-" + getModelObject().getId());
final ContextImage toogle = new ContextImage("toggle", new AbstractReadOnlyModel<String>() {
private static final long serialVersionUID = 1L;
@Override
public String getObject() {
return getWidget().isCollapsed() ? "images/up.png" : "images/down.png";
}
});
toogle.setOutputMarkupId(true);
toogle.add(new AjaxEventBehavior("onclick") {
private static final long serialVersionUID = 1L;
@Override
protected void onEvent(AjaxRequestTarget target) {
Widget widget = getWidget();
// change widget's collapsed property
widget.setCollapsed(!widget.isCollapsed());
// save the new state of widget/dashboard
Dashboard dashboard = findParent(DashboardPanel.class).getDashboard();
dashboardContext.getDashboardPersiter().save(dashboard);
// change toggle's image
target.add(toogle);
// hide/show the widget's view
WidgetView widgetView = findParent(WidgetPanel.class).getWidgetView();
target.add(widgetView);
}
});
toogle.add(new AttributeModifier("title", new AbstractReadOnlyModel<String>() {
private static final long serialVersionUID = 1L;
@Override
public String getObject() {
return getWidget().isCollapsed() ? "Show" : "Minimize";
}
}));
add(toogle);
add(new Label("title", getModelObject().getTitle()));
WidgetActionsPanel actionsPanel = new WidgetActionsPanel("actions", model);
add(actionsPanel);
}
开发者ID:U-QASAR,项目名称:u-qasar.platform,代码行数:59,代码来源:WidgetHeaderPanel.java
注:本文中的org.apache.wicket.markup.html.image.ContextImage类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论