本文整理汇总了Java中org.apache.wicket.request.resource.ByteArrayResource类的典型用法代码示例。如果您正苦于以下问题:Java ByteArrayResource类的具体用法?Java ByteArrayResource怎么用?Java ByteArrayResource使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ByteArrayResource类属于org.apache.wicket.request.resource包,在下文中一共展示了ByteArrayResource类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getPhotoModel
import org.apache.wicket.request.resource.ByteArrayResource; //导入依赖的package包/类
@Override
protected IModel<AbstractResource> getPhotoModel() {
return new AbstractReadOnlyModel<AbstractResource>() {
private static final long serialVersionUID = 1L;
@Override
public AbstractResource getObject() {
byte[] jpegPhoto = null;
O object = getModel().getObject();
if (object instanceof FocusType) {
jpegPhoto = ((FocusType) object).getJpegPhoto();
}
if (jpegPhoto == null) {
return null;
} else {
return new ByteArrayResource("image/jpeg", jpegPhoto);
}
}
};
}
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:21,代码来源:FocusSummaryPanel.java
示例2: getPhotoModel
import org.apache.wicket.request.resource.ByteArrayResource; //导入依赖的package包/类
@Override
protected IModel<AbstractResource> getPhotoModel() {
return new AbstractReadOnlyModel<AbstractResource>() {
private static final long serialVersionUID = 1L;
@Override
public AbstractResource getObject() {
byte[] jpegPhoto = null;
O object = getModel().getObject();
if (object instanceof FocusType) {
jpegPhoto = ((FocusType) object).getJpegPhoto();
}
if (jpegPhoto == null) {
return null;
} else {
return new ByteArrayResource("image/jpeg", jpegPhoto);
}
}
};
}
开发者ID:Evolveum,项目名称:midpoint,代码行数:21,代码来源:FocusSummaryPanel.java
示例3: createSaveToExcelLink
import org.apache.wicket.request.resource.ByteArrayResource; //导入依赖的package包/类
private Link<TableResource> createSaveToExcelLink(final IModel<Widget> model) {
ByteArrayResource download;
if (model.getObject() instanceof PivotWidget) {
PivotWidget pivotWidget = (PivotWidget)model.getObject();
download = new PivotResource(pivotWidget);
} else if (model.getObject() instanceof DrillDownWidget) {
download = new TableResource(model.getObject().getId(), ((DrillDownWidget)model.getObject()).getDrillEntityContext());
} else {
download = new TableResource(model.getObject().getId(), null);
}
ResourceLink resourceLink = new ResourceLink<TableResource>(MenuPanel.LINK_ID, download);
// see busy-indicator.js
// we do not want a busy indicator in this situation
resourceLink.add(new AttributeAppender("class", new Model<String>("noBusyIndicator"), " "));
return resourceLink;
}
开发者ID:nextreports,项目名称:nextreports-server,代码行数:17,代码来源:WidgetPopupMenuModel.java
示例4: HomePageByteArray
import org.apache.wicket.request.resource.ByteArrayResource; //导入依赖的package包/类
public HomePageByteArray(final PageParameters parameters) throws IOException {
super(parameters);
setVersioned(false);
add(new ResourceLink<>("download", new ByteArrayResource("text/html"){
@Override
protected byte[] getData(Attributes attributes) {
try {
return IOUtils.toByteArray(WicketApplication.getInMemoryStream());
} catch (IOException e) {
e.printStackTrace();
return null;
}
}
}));
}
开发者ID:pingunaut,项目名称:wicket-stream-download-example,代码行数:16,代码来源:HomePageByteArray.java
示例5: RoomsPanel
import org.apache.wicket.request.resource.ByteArrayResource; //导入依赖的package包/类
public RoomsPanel(String id, List<Room> rooms) {
super(id);
this.rooms = rooms;
clients = new ListView<Client>("clients", clientsInRoom){
private static final long serialVersionUID = 1L;
@Override
protected void populateItem(final ListItem<Client> item) {
Client client = item.getModelObject();
final Long userId = client.getUserId();
item.add(new Image("clientImage", new ByteArrayResource("image/jpeg") {
private static final long serialVersionUID = 1L;
@Override
protected ResourceResponse newResourceResponse(Attributes attributes) {
ResourceResponse rr = super.newResourceResponse(attributes);
rr.disableCaching();
return rr;
}
@Override
protected byte[] getData(Attributes attributes) {
String uri = null;
if (userId != null) {
uri = getBean(UserDao.class).get(userId > 0 ? userId : -userId).getPictureuri();
}
File img = OmFileHelper.getUserProfilePicture(userId, uri);
try (InputStream is = new FileInputStream(img)) {
return IOUtils.toByteArray(is);
} catch (Exception e) {
//no-op
}
return null;
}
}));
item.add(new Label("clientLogin", client.getUser().getLogin()));
item.add(new Label("from", client.getConnectedSince()));
}
};
}
开发者ID:apache,项目名称:openmeetings,代码行数:41,代码来源:RoomsPanel.java
示例6: getCategoryLogo
import org.apache.wicket.request.resource.ByteArrayResource; //导入依赖的package包/类
@Hidden
public IResource getCategoryLogo() {
if (category.getLogo() != null) {
return new ByteArrayResource(null, category.getLogo(), category.getLogoFileName());
}
return null;
}
开发者ID:subes,项目名称:invesdwin-nowicket,代码行数:9,代码来源:CategoryRow.java
示例7: getApplicationLogo
import org.apache.wicket.request.resource.ByteArrayResource; //导入依赖的package包/类
public IResource getApplicationLogo() {
if (applicationInstance.getApplication().getLogo() != null) {
return new ByteArrayResource(null, applicationInstance.getApplication().getLogo(),
applicationInstance.getApplication().getLogoFileName());
}
return null;
}
开发者ID:subes,项目名称:invesdwin-nowicket,代码行数:9,代码来源:ApplicationInstanceRow.java
示例8: createSaveToExcelLink
import org.apache.wicket.request.resource.ByteArrayResource; //导入依赖的package包/类
private Link<TableResource> createSaveToExcelLink(final IModel<TableData> model) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy_MM_dd_HH-mm-ss");
String fileName = "audit-" + type.toLowerCase() + "-" + sdf.format(new Date()) + ".xls";
ByteArrayResource download = new TableResource(excludeColumns(model.getObject()), fileName);
ResourceLink resourceLink = new ResourceLink<TableResource>("download", download);
// see busy-indicator.js
// we do not want a busy indicator in this situation
resourceLink.add(new AttributeAppender("class", new Model<String>("noBusyIndicator"), " "));
return resourceLink;
}
开发者ID:nextreports,项目名称:nextreports-server,代码行数:11,代码来源:AuditTableRendererPanel.java
注:本文中的org.apache.wicket.request.resource.ByteArrayResource类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论