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


Java ResourceReference类代码示例

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


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

示例1: init

import org.apache.wicket.ResourceReference; //导入依赖的package包/类
@Override
protected void init() {
  super.init();

  mountSharedResource("/images/percentImage_back1.png",
      new ResourceReference(WorkflowInstancesViewer.class,
          "percentImage_back1.png").getSharedResourceKey());
  mountSharedResource("/images/percentImage_back2.png",
      new ResourceReference(WorkflowInstancesViewer.class,
          "percentImage_back2.png").getSharedResourceKey());
  mountSharedResource("/images/percentImage_back3.png",
      new ResourceReference(WorkflowInstancesViewer.class,
          "percentImage_back3.png").getSharedResourceKey());
  mountSharedResource("/images/percentImage_back4.png",
      new ResourceReference(WorkflowInstancesViewer.class,
          "percentImage_back4.png").getSharedResourceKey());
}
 
开发者ID:apache,项目名称:oodt,代码行数:18,代码来源:WMMonitorApp.java

示例2: resolveResource

import org.apache.wicket.ResourceReference; //导入依赖的package包/类
protected String resolveResource(String src) {
	// if it's an absolute path, return it:
	if (src.startsWith("/") || src.startsWith("http://") || src.startsWith("https://"))
		return (src);

	// use the parent container class to resolve the resource reference
	Component parent = getParent();
	if (parent instanceof Fragment) {
		// must check for fragment, otherwise we end up in Wicket namespace
		parent = parent.getParent();
	}		
	if (parent != null) {
		ResourceReference resRef = new ResourceReference(parent.getClass(), src, false);
		return (urlFor(resRef).toString());
	}

	return (src);
}
 
开发者ID:warpfork,项目名称:gitblit,代码行数:19,代码来源:ObjectContainer.java

示例3: newLargeLogo

import org.apache.wicket.ResourceReference; //导入依赖的package包/类
public static Image newLargeLogo(String id) {
    ResourceReference imageResourceReference = new ResourceReference("logoLarge_" + System.currentTimeMillis()) {
        @Override
        protected Resource newResource() {
            SearchInterfaceConfig searchInterfaceConfig = ConstellioSpringUtils
                .getSearchInterfaceConfigServices().get();
            Resource imageResource;
            byte[] logoBytes = searchInterfaceConfig.getLogoLargeContent();
            // Convert resource path to absolute path relative to base package
            if (logoBytes != null) {
                imageResource = new ByteArrayResource("image", logoBytes);
            } else {
                imageResource = PackageResource.get(BaseConstellioPage.class, "images/logo_constellio.gif");
            }
            return imageResource;
        }
    };
    Image image = new NonCachingImage(id, imageResourceReference);
    image.setVisible(!ConstellioSession.get().isPortletMode());
    return image;
}
 
开发者ID:BassJel,项目名称:Jouve-Project,代码行数:22,代码来源:BasePageHeaderPanel.java

示例4: newSmallLogo

import org.apache.wicket.ResourceReference; //导入依赖的package包/类
public static Image newSmallLogo(String id) {
    ResourceReference imageResourceReference = new ResourceReference("logoSmall_" + System.currentTimeMillis()) {
        @Override
        protected Resource newResource() {
            SearchInterfaceConfig searchInterfaceConfig = ConstellioSpringUtils
                .getSearchInterfaceConfigServices().get();
            Resource imageResource;
            byte[] logoBytes = searchInterfaceConfig.getLogoSmallContent();
            // Convert resource path to absolute path relative to base package
            if (logoBytes != null) {
                imageResource = new ByteArrayResource("image", logoBytes);
            } else {
                imageResource = PackageResource.get(BaseConstellioPage.class, "images/logo_petit.png");
            }
            return imageResource;
        }
    };
    Image image = new NonCachingImage(id, imageResourceReference);
    image.setVisible(!ConstellioSession.get().isPortletMode());
    return image;
}
 
开发者ID:BassJel,项目名称:Jouve-Project,代码行数:22,代码来源:BasePageHeaderPanel.java

示例5: OntopolyImageLink

import org.apache.wicket.ResourceReference; //导入依赖的package包/类
public OntopolyImageLink(String id, String image, IModel<String> titleModel) {
    super(id);
    this.image = image;
    this.titleModel = titleModel;

//    this.setRenderBodyOnly(true);
    
    add(new Image("image", new AbstractReadOnlyModel<ResourceReference>() {
      @Override
      public ResourceReference getObject() {
        return new ResourceReference(ImageResource.class, getImage());
      }      
    }));
  }
 
开发者ID:ontopia,项目名称:ontopia,代码行数:15,代码来源:OntopolyImageLink.java

示例6: FieldDefinitionLabel

import org.apache.wicket.ResourceReference; //导入依赖的package包/类
public FieldDefinitionLabel(String id, final FieldDefinitionModel fieldDefinitionModel) {
  super(id);

  Topic ontologyType = getPrimaryOntologyType(fieldDefinitionModel.getFieldDefinition());    
  
  add(new TopicLink<Topic>("ontologyType", new TopicModel<Topic>(ontologyType)) {
    @Override
    public String getLabel() {
      return fieldDefinitionModel.getFieldDefinition().getFieldName();
    }      
    @Override
    public boolean isEnabled() {
      return isOntologyTypeLinkEnabled(getTopic());
    }
  });
  
  add(new TopicLink<FieldDefinition>("fieldDefinition", fieldDefinitionModel) {
    @Override
    protected String getLabel() {
      return "<img src=\"" +  RequestCycle.get().urlFor(new ResourceReference(ImageResource.class, "goto-details.gif"), ValueMap.EMPTY_MAP) + "\"/>";
    }
    @Override
    public boolean getEscapeLabel() {
      return false;
    }
    @Override
    public boolean isVisible() {
      return isFieldDefinitionLinkEnabled(getTopic()); 
    }
    @Override
    public boolean isEnabled() {
      return isFieldDefinitionLinkEnabled(getTopic());
    }
  });
  
}
 
开发者ID:ontopia,项目名称:ontopia,代码行数:37,代码来源:FieldDefinitionLabel.java

示例7: initComponents

import org.apache.wicket.ResourceReference; //导入依赖的package包/类
private void initComponents(IModel titleModel) {
    titleSection = new WebMarkupContainer("titleSection");
    add(titleSection);
    titleSection.add(new SimpleAttributeModifier("class", getTitleSectionStyleClass()));

    toggleLink = newToggleLink("toggleLink");
    titleSection.add(toggleLink);
    toggleLink.add(new Label("title", titleModel));

    toggleImg = new NonCachingImage("toggleImg") {
        @Override
        protected ResourceReference getImageResourceReference() {
            ResourceReference imageResourceReference;
            if (isOpened()) {
                imageResourceReference = OPENED_IMG_RESOURCE_REFERENCE;
            } else {
                imageResourceReference = CLOSED_IMG_RESOURCE_REFERENCE;
            }
            return imageResourceReference;
        }
    };
    toggleImg.setOutputMarkupId(true);
    toggleLink.add(toggleImg);

    foldableSectionContainer = newFoldableSectionContainer("foldableSectionContainer");
    foldableSectionContainer.setOutputMarkupId(true);
    add(foldableSectionContainer);
    foldableSection = newFoldableSection("foldableSection");
    foldableSectionContainer.add(foldableSection);
    foldableSection.setOutputMarkupId(true);
}
 
开发者ID:BassJel,项目名称:Jouve-Project,代码行数:32,代码来源:FoldableSectionPanel.java

示例8: getDateIconURL

import org.apache.wicket.ResourceReference; //导入依赖的package包/类
protected CharSequence getDateIconURL() {
  return RequestCycle.get().urlFor(new ResourceReference(ImageResource.class, "datepicker.gif"), ValueMap.EMPTY_MAP);
}
 
开发者ID:ontopia,项目名称:ontopia,代码行数:4,代码来源:DatePickerBehavior.java

示例9: OntopolyImage

import org.apache.wicket.ResourceReference; //导入依赖的package包/类
public OntopolyImage(String id, final String image, IModel<String> titleModel) {
  super(id, new ResourceReference(ImageResource.class, image));
  this.titleModel = titleModel;
}
 
开发者ID:ontopia,项目名称:ontopia,代码行数:5,代码来源:OntopolyImage.java

示例10: renderHead

import org.apache.wicket.ResourceReference; //导入依赖的package包/类
@Override
public void renderHead(IHeaderResponse response) {
    super.renderHead(response);
    response.renderJavascriptReference(new ResourceReference(
        WicketAjaxJsPatch.class, "wicket-ajax-patch.js"));
}
 
开发者ID:camaradosdeputadosoficial,项目名称:edemocracia,代码行数:7,代码来源:WicketAjaxJsPatch.java

示例11: getUpOrDownArrowRef

import org.apache.wicket.ResourceReference; //导入依赖的package包/类
private ResourceReference getUpOrDownArrowRef(String status) {
  return new ResourceReference(HealthMonitor.class, "icon_arrow_"
      + status.toLowerCase() + ".gif");
}
 
开发者ID:apache,项目名称:oodt,代码行数:5,代码来源:HealthMonitor.java

示例12: urlFor

import org.apache.wicket.ResourceReference; //导入依赖的package包/类
public static String urlFor(String basePageRelativeUrl) {
	return RequestCycle.get().urlFor(new ResourceReference(
			BaseConstellioPage.class, 
			basePageRelativeUrl)).toString();
}
 
开发者ID:BassJel,项目名称:Jouve-Project,代码行数:6,代码来源:WicketResourceUtils.java


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