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


Java IResource类代码示例

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


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

示例1: AServerTitlePanel

import org.apache.wicket.request.resource.IResource; //导入依赖的package包/类
public AServerTitlePanel(final String id, final IResource logoModel, final IModel<String> badgeModel) {
    super(id);
    if (logoModel == null) {
        add(new WebMarkupContainer("logo").setVisible(false));
    } else {
        final Image logo = new Image("logo", logoModel);
        add(logo);
    }

    final Label badge = new Label("badge", badgeModel);
    add(badge);

    final Component link = newLink("link");
    add(link);

    final Component button = newButton("button");
    add(button);

    final Component crud = newCrudPanel("crud");
    add(crud);
}
 
开发者ID:subes,项目名称:invesdwin-nowicket,代码行数:22,代码来源:AServerTitlePanel.java

示例2: ACustomTitlePanel

import org.apache.wicket.request.resource.IResource; //导入依赖的package包/类
public ACustomTitlePanel(final String id, final IResource logoModel, final IModel<String> badgeModel) {
    super(id);
    if (logoModel == null) {
        add(new WebMarkupContainer("logo").setVisible(false));
    } else {
        final Image logo = new Image("logo", logoModel);
        add(logo);
    }

    final Label badge = new Label("badge", badgeModel);
    add(badge);

    final Component link = newLink("link");
    add(link);

    final Component button = newButton("button");
    add(button);
}
 
开发者ID:subes,项目名称:invesdwin-nowicket,代码行数:19,代码来源:ACustomTitlePanel.java

示例3: isResourceAuthorized

import org.apache.wicket.request.resource.IResource; //导入依赖的package包/类
@Override
public boolean isResourceAuthorized(IResource resource,
		PageParameters parameters) {
	RequiredOrientResource[] resources = getRequiredOrientResources(resource.getClass());
	if(resources!=null)
	{
		if(!checkResources(resources, Component.RENDER)) return false;
	}
	if(resource instanceof ISecuredComponent)
	{
		resources = ((ISecuredComponent)resource).getRequiredResources();
		if(resources!=null)
		{
			if(!checkResources(resources, Component.RENDER)) return false;
		}
	}
	return true;
}
 
开发者ID:OrienteerBAP,项目名称:wicket-orientdb,代码行数:19,代码来源:OrientResourceAuthorizationStrategy.java

示例4: ImageModalPanel

import org.apache.wicket.request.resource.IResource; //导入依赖的package包/类
public ImageModalPanel(final BaseModal<T> modal, final byte[] content, final PageReference pageRef) {
    super(modal, pageRef);

    Image image = new Image("image", new Model<IResource>()) {

        private static final long serialVersionUID = -8457850449086490660L;

        @Override
        protected IResource getImageResource() {
            return new DynamicImageResource() {

                private static final long serialVersionUID = 923201517955737928L;

                @Override
                protected byte[] getImageData(final IResource.Attributes attributes) {
                    return content;
                }
            };
        }
    };
    image.setOutputMarkupId(true);
    add(image);
}
 
开发者ID:apache,项目名称:syncope,代码行数:24,代码来源:ImageModalPanel.java

示例5: HtmlIFramePanel

import org.apache.wicket.request.resource.IResource; //导入依赖的package包/类
public HtmlIFramePanel(String id, final IModel<String> htmlModel) {

        super(id);

        IResource resource = new IResource() {
            @Override
            public void respond(Attributes attributes) {
                WebResponse response = (WebResponse) attributes.getResponse();
                response.setContentType("text/html; charset=utf-8");
                response.write(htmlModel.getObject());
            }
        };

        setResource(resource);

    }
 
开发者ID:jkrasnay,项目名称:panelized,代码行数:17,代码来源:HtmlIFramePanel.java

示例6: getResource

import org.apache.wicket.request.resource.IResource; //导入依赖的package包/类
@Override
public IResource getResource() {
	ConcatBundleResource bundleResource = new ConcatBundleResource(getProvidedResources()) {

		@Override
		protected byte[] readAllResources(List<IResourceStream> resources)
				throws IOException, ResourceStreamNotFoundException {
			ByteArrayOutputStream output = new ByteArrayOutputStream();
			for (IResourceStream curStream : resources) {
				IOUtils.copy(curStream.getInputStream(), output);
				output.write(";".getBytes());
			}

			byte[] bytes = output.toByteArray();

			if (getCompressor() != null) {
				String nonCompressed = new String(bytes, "UTF-8");
				bytes = getCompressor().compress(nonCompressed).getBytes("UTF-8");
			}

			return bytes;
		}
		
	};
	ITextResourceCompressor compressor = getCompressor();
	if (compressor != null) {
		bundleResource.setCompressor(compressor);
	}
	return bundleResource;
}
 
开发者ID:jmfgdev,项目名称:gitplex-mit,代码行数:31,代码来源:JavaScriptConcatResourceBundleReference.java

示例7: getCategoryLogo

import org.apache.wicket.request.resource.IResource; //导入依赖的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

示例8: getApplicationLogo

import org.apache.wicket.request.resource.IResource; //导入依赖的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

示例9: getResourceModel

import org.apache.wicket.request.resource.IResource; //导入依赖的package包/类
@SuppressWarnings({ "unchecked", "rawtypes" })
public IModel<IResource> getResourceModel() {
    if (getType() == AnchorType.RESOURCE) {
        return (IModel) super.getModel();
    } else {
        return null;
    }
}
 
开发者ID:subes,项目名称:invesdwin-nowicket,代码行数:9,代码来源:AnchorHtmlElement.java

示例10: newLink

import org.apache.wicket.request.resource.IResource; //导入依赖的package包/类
@SuppressWarnings({ "unchecked", "rawtypes" })
protected ModelResourceLink newLink(final String componentId, final IModel<IResource> rowModel) {
    return new ModelResourceLink(componentId, (IResource) getDataModel(rowModel).getObject(),
            element.getTitleModel((IModel) rowModel)) {
        @Override
        protected void onComponentTag(final ComponentTag tag) {
            tag.setName("a");
            super.onComponentTag(tag);
        }
    };
}
 
开发者ID:subes,项目名称:invesdwin-nowicket,代码行数:12,代码来源:ModelResourceAnchorColumn.java

示例11: EmbeddableImage

import org.apache.wicket.request.resource.IResource; //导入依赖的package包/类
public EmbeddableImage(String aComponentId, IResource aResource)
{
    super(aComponentId);
    add(new Image("image", aResource) {
        private static final long serialVersionUID = 1L;
        
        @Override
        protected boolean shouldAddAntiCacheParameter()
        {
            return false;
        }
    });
}
 
开发者ID:webanno,项目名称:webanno,代码行数:14,代码来源:EmbeddableImage.java

示例12: mountResource

import org.apache.wicket.request.resource.IResource; //导入依赖的package包/类
/**
 * Mount a resource.
 *
 * @param path     The path of the resource.
 * @param resource The resource itself
 */
private void mountResource(String path, final IResource resource) {
    mountResource(path, new ResourceReference(path) {
        @Override
        public IResource getResource() {
            return resource;
        }
    });
}
 
开发者ID:alancnet,项目名称:artifactory,代码行数:15,代码来源:ArtifactoryApplication.java

示例13: GalleryImageRenderer

import org.apache.wicket.request.resource.IResource; //导入依赖的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

示例14: JpegImage

import org.apache.wicket.request.resource.IResource; //导入依赖的package包/类
public JpegImage( String id )
{
    super( id );
    setImageResource( new DynamicImageResource()
    {
        /** Default serialVersionUID */
        private static final long serialVersionUID = 1L;


        protected byte[] getImageData( IResource.Attributes attributes )
        {
            return getPhoto();
        }
    } );
}
 
开发者ID:apache,项目名称:directory-fortress-commander,代码行数:16,代码来源:JpegImage.java

示例15: asReference

import org.apache.wicket.request.resource.IResource; //导入依赖的package包/类
public static ResourceReference asReference() {
	return new ResourceReference(UserPictureResource.class.getCanonicalName()) {
		@Override
		public IResource getResource() {
			return new UserPictureResource();
		}
	};
}
 
开发者ID:U-QASAR,项目名称:u-qasar.platform,代码行数:9,代码来源:UserPictureResource.java


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