本文整理汇总了Java中org.apache.wicket.markup.html.image.Image.add方法的典型用法代码示例。如果您正苦于以下问题:Java Image.add方法的具体用法?Java Image.add怎么用?Java Image.add使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.wicket.markup.html.image.Image
的用法示例。
在下文中一共展示了Image.add方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: renderImage
import org.apache.wicket.markup.html.image.Image; //导入方法依赖的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;
}
示例2: FieldInstanceImageField
import org.apache.wicket.markup.html.image.Image; //导入方法依赖的package包/类
public FieldInstanceImageField(String id, FieldValueModel _fieldValueModel, boolean readonly) {
super(id);
this.fieldValueModel = _fieldValueModel;
image = new Image("image");
image.add(new AttributeModifier("src", true, new AbstractReadOnlyModel<String>() {
@Override
public final String getObject() {
TopicMap topicMap = fieldValueModel.getFieldInstanceModel().getFieldInstance().getInstance().getTopicMap();
Object o = fieldValueModel.getFieldValue();
return getRequest().getRelativePathPrefixToContextRoot() + "occurrenceImages?topicMapId=" + topicMap.getId() +
"&occurrenceId=" + ((o instanceof OccurrenceIF ? ((OccurrenceIF)o).getObjectId(): "unknown"));
}
}));
upload = new UploadPanel("upload", this);
add(image);
add(upload);
if (fieldValueModel.isExistingValue()) {
upload.setVisible(false);
} else {
image.setVisible(false);
if (readonly)
upload.setVisible(false);
}
}
示例3: getLoadingComponent
import org.apache.wicket.markup.html.image.Image; //导入方法依赖的package包/类
protected Component getLoadingComponent(final String markupId) {
Image image = new Image(markupId, PRELOADER);
image.add(new VisibleEnableBehaviour() {
@Override
public boolean isVisible() {
return isLoadingVisible();
}
});
return image;
}
示例4: onBeforeRender
import org.apache.wicket.markup.html.image.Image; //导入方法依赖的package包/类
@Override
protected void onBeforeRender()
{
// Defer adding the image until rendering because we need to access the properties from
// the embedding component/page
if (!hasBeenRendered()) {
ResourceReference _imageRes = imageRes;
if (_imageRes == null) {
_imageRes = new UrlResourceReference(Url.parse(getString("icon")))
.setContextRelative(true);
}
Image image = new Image("image", _imageRes);
try {
// The getString method throws an MissingResourceException if the property is
// not available. In this case, we simply do not set a tooltip
getString("tooltip");
image.add(new AttributeModifier("title",
new StringResourceModel("tooltip", ActionBarLink.this)));
}
catch (MissingResourceException e) {
// Nothing to do
}
link.add(image);
}
super.onBeforeRender();
}
示例5: addIconToPanel
import org.apache.wicket.markup.html.image.Image; //导入方法依赖的package包/类
private void addIconToPanel(final String imageUrl) {
Image packageIcon = new Image("packageIcon", "Icon");
packageIcon.add(new AttributeModifier("src", new AbstractReadOnlyModel() {
@Override
public Object getObject() {
return imageUrl;
}
}));
infoBorder.add(packageIcon);
}
示例6: adddIconToPanel
import org.apache.wicket.markup.html.image.Image; //导入方法依赖的package包/类
private void adddIconToPanel() {
final String imageUrl = ConstantValues.bintrayApiUrl.getString() + "/packages/bintray/jcenter/unknownPackage/images/avatar";
Image packageIcon = new Image("packageIcon", "Icon");
packageIcon.add(new AttributeModifier("src", new AbstractReadOnlyModel() {
@Override
public Object getObject() {
return imageUrl;
}
}));
add(packageIcon);
}
示例7: GalleryImageRenderer
import org.apache.wicket.markup.html.image.Image; //导入方法依赖的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)));
}
}
示例8: LinkImagePanel
import org.apache.wicket.markup.html.image.Image; //导入方法依赖的package包/类
/**
* Instantiates a new link image panel.
*
* @param id the id
* @param column the column
* @param rowModel the row model
*/
public LinkImagePanel(String id, final AjaxActionIconColumn<T> column, IModel<T> rowModel) {
super(id);
AjaxLink<T> link = new AjaxLink<T>("link", rowModel) {
@Override
public void onClick(AjaxRequestTarget target) {
column.onClick(getModel(), target);
}
@Override
public boolean isEnabled() {
return column.isEnabled(getModel());
}
@Override
public boolean isVisible() {
return column.isVisible(getModel());
}
};
add(link);
Image icon = new Image("icon", column.getIcon(rowModel)) {
@Override
protected boolean shouldAddAntiCacheParameter() {
return WebApplication.get().usesDevelopmentConfig();
}
};
String tooltip = column.getTooltip(rowModel);
if (tooltip != null) {
icon.add(new AttributeAppender("title", tooltip));
}
link.add(icon);
}
示例9: LinkImagePanel
import org.apache.wicket.markup.html.image.Image; //导入方法依赖的package包/类
/**
* Instantiates a new link image panel.
*
* @param id the id
* @param column the column
* @param rowModel the row model
*/
public LinkImagePanel(String id, final ActionIconColumn<T> column, IModel<T> rowModel) {
super(id);
Link<T> link = new Link<T>("link", rowModel) {
@Override
public void onClick() {
column.onClick(getModel());
}
@Override
public boolean isEnabled() {
return column.isEnabled(getModel());
}
@Override
public boolean isVisible() {
return column.isVisible(getModel());
}
};
add(link);
Image icon = new Image("icon", column.getIcon(rowModel)) {
@Override
protected boolean shouldAddAntiCacheParameter() {
return WebApplication.get().usesDevelopmentConfig();
}
};
String tooltip = column.getTooltip(rowModel);
if (tooltip != null) {
icon.add(new AttributeAppender("title", tooltip));
}
link.add(icon);
}