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


Java DownloadLink类代码示例

本文整理汇总了Java中org.apache.wicket.markup.html.link.DownloadLink的典型用法代码示例。如果您正苦于以下问题:Java DownloadLink类的具体用法?Java DownloadLink怎么用?Java DownloadLink使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


DownloadLink类属于org.apache.wicket.markup.html.link包,在下文中一共展示了DownloadLink类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: buildGui

import org.apache.wicket.markup.html.link.DownloadLink; //导入依赖的package包/类
private void buildGui() {

        final EntityCollectionModel model = getModel();
        
        final NotificationPanel feedback = new NotificationPanel(ID_FEEDBACK);
        feedback.setOutputMarkupId(true);
        addOrReplace(feedback);

        final LoadableDetachableModel<File> fileModel = new ExcelFileModel(model);
        final String xlsxFileName = xlsxFileNameFor(model);
        final DownloadLink link = new ExcelFileDownloadLink(ID_DOWNLOAD, fileModel, xlsxFileName);
        
        addOrReplace(link);
    }
 
开发者ID:isisaddons-legacy,项目名称:isis-wicket-excel,代码行数:15,代码来源:CollectionContentsAsExcel.java

示例2: HomePageTmpFile

import org.apache.wicket.markup.html.link.DownloadLink; //导入依赖的package包/类
public HomePageTmpFile(final PageParameters parameters) throws IOException {
	super(parameters);
	setVersioned(false);

	add(new DownloadLink("download", new LoadableDetachableModel<File>(){

		@Override
		protected File load() {
			Path p;
			try {
				p = Files.createTempFile("google", "html");
				Files.copy(WicketApplication.getInMemoryStream(), p, StandardCopyOption.REPLACE_EXISTING);
				return p.toFile();
			} catch (IOException e) {
				return null;
			}
			
		}
		
	}, Model.of("google.html")).setDeleteAfterDownload(true));
	
}
 
开发者ID:pingunaut,项目名称:wicket-stream-download-example,代码行数:23,代码来源:HomePageTmpFile.java

示例3: DownloadLinkHolder

import org.apache.wicket.markup.html.link.DownloadLink; //导入依赖的package包/类
public DownloadLinkHolder(String id, File file, String fileName) {
	super(id);
	
	DownloadLink downloadLink = new DownloadLink("downloadLink", file);
	add(downloadLink);
	downloadLink.add(new Label("fileName", fileName));
}
 
开发者ID:BassJel,项目名称:Jouve-Project,代码行数:8,代码来源:DownloadLinkHolder.java

示例4: Index

import org.apache.wicket.markup.html.link.DownloadLink; //导入依赖的package包/类
public Index(String app) {
	setVersioned(false);
	final String theApp = LogService.isAppRegistered(app) ? app : null;

	serverDate = new Label("serverDate", LogService.getFormattedDate(new Date()));
	serverDate.setOutputMarkupId(true);

	add(new Label("title", theApp != null ? String.format("[%s]@Web4Log", theApp) : "Web4Log"));
	add(new Label("headerLabel", ConfigService.getString("header.label")));
	add(serverDate);

	appListContainer = new WebMarkupContainer("appListContainer");
	appListContainer.setOutputMarkupId(true);
	add(appListContainer);

	appListContainer.add(new ListView<AppInfo>("appList", LogService.getAppList()) {
		@Override
		protected void populateItem(final ListItem<AppInfo> item) {
			final AppInfo anAppInfo = item.getModelObject();
			WebComponent stat = new WebComponent("stat");
			stat.add(new AttributeModifier("class", anAppInfo.isConnected() ? "fa fa-link" : "fa fa-chain-broken"));
			stat.add(new AttributeModifier("style", String.format("color:%s;", anAppInfo.isConnected() ? "#8aff27" : "red")));

			Label selectedAppLbl = new Label("selectedApp", anAppInfo.getName());
			Link<String> appLink = new Link<String>("appLink") {
				@Override
				public void onClick() {
					setResponsePage(new Index(anAppInfo.getName()));
				}
			};
			appLink.add(new Label("appLinkLabel", anAppInfo.getName()));

			selectedAppLbl.setVisible(anAppInfo.getName().equals(theApp));
			appLink.setVisible(!selectedAppLbl.isVisible());

			item.add(stat);
			item.add(selectedAppLbl);
			item.add(appLink);
			item.add(new DownloadLink("downloadLogFile", new File(LogService.getLogFileLocation(anAppInfo.getName())))
				.setCacheDuration(Duration.NONE));
		}
	});

	add(
		new TailRemoteLogPanel("tailPanel")
			.setRemoteApp(theApp)
			.setVisible(theApp != null)
	);

	add(new AbstractAjaxTimerBehavior(Duration.ONE_MINUTE) {
		@Override
		protected void onTimer(AjaxRequestTarget target) {
			serverDate.setDefaultModel(new Model<Serializable>(LogService.getFormattedDate(new Date())));
			target.add(serverDate);
		}
	});
}
 
开发者ID:mbizhani,项目名称:web4log,代码行数:58,代码来源:Index.java

示例5: createFileDownload

import org.apache.wicket.markup.html.link.DownloadLink; //导入依赖的package包/类
@Override
public Component createFileDownload(FileDownloadElement e) {
    IModel<File> model = e.getModel();
    DownloadLink downloadLink = new DownloadLink(e.getWicketId(), model);
    return downloadLink;
}
 
开发者ID:Nocket,项目名称:nocket,代码行数:7,代码来源:DefaultBindingBuilder.java

示例6: onInitialize

import org.apache.wicket.markup.html.link.DownloadLink; //导入依赖的package包/类
@Override
public void onInitialize() {
    super.onInitialize();

    //get list of assignments. this allows us to build the columns and then fetch the grades for each student for each assignment from the map
    assignments = businessService.getGradebookAssignments();

    //get the grade matrix
    grades = businessService.buildGradeMatrix(assignments);

    add(new DownloadLink("downloadFullGradebook", new LoadableDetachableModel<File>() {

        @Override
        protected File load() {
            return buildFile(true);

        }
    }).setCacheDuration(Duration.NONE).setDeleteAfterDownload(true));


    add(new UploadForm("form"));
}
 
开发者ID:steveswinsburg,项目名称:gradebookNG,代码行数:23,代码来源:GradeImportUploadStep.java

示例7: LinkPanel

import org.apache.wicket.markup.html.link.DownloadLink; //导入依赖的package包/类
LinkPanel(String id, IModel<File> file, IModel<String> type, IModel<String> name) {
    super(id);
    add(new DownloadLink("file", file, name).setBody(new FileNameAndFormatAndSizeModel(file, type, name)));
}
 
开发者ID:documents4j,项目名称:documents4j,代码行数:5,代码来源:LinkPanel.java


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