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


Java PackageResourceReference类代码示例

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


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

示例1: initLayout

import org.apache.wicket.request.resource.PackageResourceReference; //导入依赖的package包/类
private void initLayout() {
    Form mainForm = new Form("mainForm");
    mainForm.setMultiPart(true);
    add(mainForm);

    WebMarkupContainer protectedMessage = new WebMarkupContainer(ID_PROTECTED_MESSAGE);
    protectedMessage.add(new VisibleEnableBehaviour() {

        @Override
        public boolean isVisible() {
            ObjectWrapper wrapper = accountModel.getObject();
            return wrapper.isProtectedAccount();
        }
    });
    mainForm.add(protectedMessage);

    PrismObjectPanel<ShadowType> userForm = new PrismObjectPanel<ShadowType>("account", accountModel, new PackageResourceReference(
            ImgResources.class, ImgResources.HDD_PRISM), mainForm, this);
    mainForm.add(userForm);

    initButtons(mainForm);
}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:23,代码来源:PageAccount.java

示例2: randomizeOncePerRequestCycle

import org.apache.wicket.request.resource.PackageResourceReference; //导入依赖的package包/类
private void randomizeOncePerRequestCycle() {
    if (lastRandomizedRequestCycle != RequestCycle.get()) {
        lastRandomizedRequestCycle = RequestCycle.get();
        Assertions.assertThat(lastRandomizedRequestCycle == RequestCycle.get())
                .as("RequestCycle.get() always returns a different instance?!?")
                .isTrue(); //sanity check
        final List<ICarouselImage> imgs = new ArrayList<ICarouselImage>();
        for (int i = 1; i <= 5; i++) {
            final String path = "FrameworkSlogan_" + i + ".jpg";
            final PackageResourceReference resource = new PackageResourceReference(getClass(), path);
            final Url url = RequestCycle.get().mapUrlFor(resource, null);
            imgs.add(new CarouselImage(url.toString()));
        }
        Collections.shuffle(imgs);
        frameworkSloganImgs = imgs;
    }
}
 
开发者ID:subes,项目名称:invesdwin-nowicket,代码行数:18,代码来源:Introduction.java

示例3: initLayout

import org.apache.wicket.request.resource.PackageResourceReference; //导入依赖的package包/类
private void initLayout() {
		
//		ContainerWrapperFromObjectWrapperModel<F, F> basicContainerModel = new ContainerWrapperFromObjectWrapperModel<>(getObjectWrapperModel(), ItemPath.EMPTY_PATH);
//		PrismContainerPanel<F> mainContainer = new PrismContainerPanel<>(ID_FOCUS_MAIN_PANEL, basicContainerModel, false, getMainForm(), getPageBase());
//		add(mainContainer);
//
//		ContainerWrapperFromObjectWrapperModel<F, F> activationContainerModel = new ContainerWrapperFromObjectWrapperModel<>(getObjectWrapperModel(), SchemaConstants.PATH_ACTIVATION);
//		PrismContainerPanel<F> activationContainerPanel = new PrismContainerPanel<>(ID_FOCUS_ACTIVATION_PANEL, activationContainerModel, false, getMainForm(), getPageBase());
//		add(activationContainerPanel);
//		
//		ContainerWrapperFromObjectWrapperModel<F, F> passwordContainerModel = new ContainerWrapperFromObjectWrapperModel<>(getObjectWrapperModel(), SchemaConstants.PATH_PASSWORD);
//		PrismContainerPanel<F> passwordContainerPanel = new PrismContainerPanel<>(ID_FOCUS_PASSWORD_PANEL, passwordContainerModel, false, getMainForm(), getPageBase());
//		add(passwordContainerPanel);

		
		PrismPanel<F> panel = new PrismPanel<F>(ID_FOCUS_FORM,  new ContainerWrapperListFromObjectWrapperModel(getObjectWrapperModel(), getVisibleContainers()),
				new PackageResourceReference(ImgResources.class, ImgResources.USER_PRISM), getMainForm(), 
				null, getPageBase());
		add(panel);
	}
 
开发者ID:Evolveum,项目名称:midpoint,代码行数:21,代码来源:FocusDetailsTabPanel.java

示例4: initLayout

import org.apache.wicket.request.resource.PackageResourceReference; //导入依赖的package包/类
private void initLayout() {
    Form mainForm = new com.evolveum.midpoint.web.component.form.Form("mainForm");
    mainForm.setMultiPart(true);
    add(mainForm);

    WebMarkupContainer protectedMessage = new WebMarkupContainer(ID_PROTECTED_MESSAGE);
    protectedMessage.add(new VisibleEnableBehaviour() {

        @Override
        public boolean isVisible() {
            ObjectWrapper wrapper = accountModel.getObject();
            return wrapper.isProtectedAccount();
        }
    });
    mainForm.add(protectedMessage);

    PrismPanel<ShadowType> userForm = new PrismPanel<ShadowType>("account", new ContainerWrapperListFromObjectWrapperModel<>(accountModel, WebComponentUtil.getShadowItemsToShow()), new PackageResourceReference(
            ImgResources.class, ImgResources.HDD_PRISM), mainForm, 
    		itemWrapper -> WebComponentUtil.checkShadowActivationAndPasswordVisibility(itemWrapper, accountModel), this);
    mainForm.add(userForm);
    
    initButtons(mainForm);
}
 
开发者ID:Evolveum,项目名称:midpoint,代码行数:24,代码来源:PageAccount.java

示例5: init

import org.apache.wicket.request.resource.PackageResourceReference; //导入依赖的package包/类
/**
 * @see org.apache.wicket.Application#init()
 */
@Override
public void init() {
	super.init();

	getMarkupSettings().setMarkupFactory(getMarkupFactory());
	getPageSettings().addComponentResolver(new LabelI18NMarkupFilter());
	getJavaScriptLibrarySettings().setJQueryReference(new PackageResourceReference(JQueryHelper.class, JQueryHelper.getCurrentVersion()));

	initGenguiWebConfiguration();
	initGenguiI18N();
	initInMemoryCompilation();
	initOnTheFlyHTMLCreation();
	initGenguiClassbasedCaching();
	initStylingResourceMounting();
}
 
开发者ID:Nocket,项目名称:nocket,代码行数:19,代码来源:NocketWebApplication.java

示例6: renderHead

import org.apache.wicket.request.resource.PackageResourceReference; //导入依赖的package包/类
@Override
public void renderHead(IHeaderResponse response) {
	if (modalPanel == null) {
		return;
	}

	JQueryHelper.initJQuery(response);
	//response.render(CssHeaderItem.forReference(new PackageResourceReference(DMDModalWindow.class, "DMDModalWindow.css")));
	response.render(JavaScriptHeaderItem.forReference(new PackageResourceReference(DMDModalWindow.class, "DMDModalWindow.js")));

	if (doShow) {
		String setDimensionToModalFooter = "";
		if (dimension != null) {
			setDimensionToModalFooter = "dmdModalWindowSetzeHoeheAnModalBody(" + (int) dimension.getHeight() + ", " + 1200 + ");";
		}
		// Bootstrap macht bei jeder Form einen margin-bottom von 20px.
		// Dieses ist in der modalen Box sehr störend und muss per
		// Javascript korrigiert werden
		response.render(OnDomReadyHeaderItem.forScript("dmdModalWindowKorrigiereFormMargin(); zeigeBlockerWennModalPanelVorhanden(); "
				+ setDimensionToModalFooter));
	}
	else {
		response.render(OnLoadHeaderItem.forScript("zeigeBlockerWennModalPanelVorhanden();"));
	}
}
 
开发者ID:Nocket,项目名称:nocket,代码行数:26,代码来源:DMDModalWindow.java

示例7: renderHead

import org.apache.wicket.request.resource.PackageResourceReference; //导入依赖的package包/类
@Override
    public void renderHead(Component component, IHeaderResponse response) {
        super.renderHead(component, response);

        response.render(CssHeaderItem.forReference(new PackageResourceReference(SlidebarBehavior.class, "slidebars.css")));
        response.render(CssHeaderItem.forUrl("css/slidebar.css"));
        response.render(JavaScriptHeaderItem.forReference(new PackageResourceReference(SlidebarBehavior.class, "slidebars.js")));

        Map<String, String> vars = new HashMap<String, String>();
//        vars.put("siteClose", "true");

        PackageTextTemplate template = new PackageTextTemplate(SlidebarBehavior.class, "slidebar-behavior.template.js");
//        template.interpolate(vars);

        response.render(OnDomReadyHeaderItem.forScript(template.getString()));
    }
 
开发者ID:nextreports,项目名称:nextreports-server,代码行数:17,代码来源:SlidebarBehavior.java

示例8: renderHead

import org.apache.wicket.request.resource.PackageResourceReference; //导入依赖的package包/类
@Override
public void renderHead(Component component, IHeaderResponse response) {
	super.renderHead(component, response);
	response.render(JavaScriptReferenceHeaderItem.forReference(new InfiniteScrollResourceReference()));
	
	CharSequence url = RequestCycle.get().urlFor(new PackageResourceReference(
			InfiniteScrollBehavior.class, "ajax-indicator.gif"), new PageParameters());
	String script = String.format("gitplex.infiniteScroll.init('%s', %s, '%s', %s);", 
			component.getMarkupId(true), getCallbackFunction(explicit("page")), url, pageSize);
	response.render(OnDomReadyHeaderItem.forScript(script));
}
 
开发者ID:jmfgdev,项目名称:gitplex-mit,代码行数:12,代码来源:InfiniteScrollBehavior.java

示例9: create

import org.apache.wicket.request.resource.PackageResourceReference; //导入依赖的package包/类
@Override
public ResourceReference create(Key key) {
	if (PackageResource.exists(key)) {
		return new PackageResourceReference(key);
	} else {
		for (ConcatResourceBundleReference<? extends IReferenceHeaderItem> bundle: bundles) {
			if (bundle.getScope().getName().equals(key.getScope())) {
				String bundleParentPath = getParentPath(bundle.getName());
				String relativePath;
				if (bundleParentPath != null)
					relativePath = PathUtils.relativize(bundleParentPath, key.getName());
				else
					relativePath = key.getName();
				for (IReferenceHeaderItem headerItem: bundle.getProvidedResources()) {
					String referenceParentPath = getParentPath(headerItem.getReference().getName());
					String possibleName;
					if (referenceParentPath != null)
						possibleName = PathUtils.resolve(referenceParentPath, relativePath);
					else
						possibleName = relativePath.toString();
					possibleName = PathUtils.normalize(possibleName);
					if (possibleName != null) {
						Key possibleKey = new Key(headerItem.getReference().getScope().getName(), possibleName, 
								key.getLocale(), key.getStyle(), key.getVariation());
						if (PackageResource.exists(possibleKey)) {
							return new PackageResourceReference(possibleKey);
						}
					}
				}
			}
		}
		return null;
	}
}
 
开发者ID:jmfgdev,项目名称:gitplex-mit,代码行数:35,代码来源:BundleAwareResourceReferenceFactory.java

示例10: render

import org.apache.wicket.request.resource.PackageResourceReference; //导入依赖的package包/类
private void render(EmojiNode node, NodeRendererContext context, HtmlWriter html) {
  	String emojiName = node.getText().toString();
  	String emojiUrl = null;
if (RequestCycle.get() != null) {
	String emojiCode = EmojiOnes.getInstance().all().get(emojiName);
	if (emojiCode != null) {
		emojiUrl = RequestCycle.get().urlFor(new PackageResourceReference(
				EmojiOnes.class, "icon/" + emojiCode + ".png"), new PageParameters()).toString();
	} 
}

if (emojiUrl != null) {
          ResolvedLink resolvedLink = context.resolveLink(LinkType.IMAGE, emojiUrl, null);
          html.attr("src", emojiUrl);
          html.attr("alt", "emoji " + emojiName);
          if (!attrImageSize.isEmpty()) 
          	html.attr("height", attrImageSize).attr("width", attrImageSize);
          if (!attrAlign.isEmpty()) 
          	html.attr("align", attrAlign);
          html.withAttr(resolvedLink);
          html.tagVoid("img");
} else {
          // output as text
          html.text(":");
          context.renderChildren(node);
          html.text(":");
}

  }
 
开发者ID:jmfgdev,项目名称:gitplex-mit,代码行数:30,代码来源:EmojiNodeRenderer.java

示例11: renderHead

import org.apache.wicket.request.resource.PackageResourceReference; //导入依赖的package包/类
@Override
public void renderHead(IHeaderResponse response) {
	super.renderHead(response);

	response.render(CssHeaderItem.forReference(
			new PackageResourceReference(AssignmentEditorPanel.class, "AssignmentEditorPanel.css")));
}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:8,代码来源:AssignmentEditorPanel.java

示例12: renderHead

import org.apache.wicket.request.resource.PackageResourceReference; //导入依赖的package包/类
@Override
public void renderHead(IHeaderResponse response) {
    super.renderHead(response);

    response.render(JavaScriptHeaderItem.forReference(
            new PackageResourceReference(Accordion.class, "Accordion.js")));
    response.render(CssHeaderItem.forReference(
            new PackageResourceReference(Accordion.class, "Accordion.css")));

    WebMarkupContainer parent = (WebMarkupContainer) get("parent");
    response.render(OnDomReadyHeaderItem.forScript("createAccordion('" + parent.getMarkupId()
            + "'," + getExpanded() + "," + getMultipleSelect() + "," + getOpenedPanel() + ")"));
}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:14,代码来源:Accordion.java

示例13: configureReload

import org.apache.wicket.request.resource.PackageResourceReference; //导入依赖的package包/类
private void configureReload(WebPage destination) {
    destination.add(new Behavior() {
        @Override
        public void renderHead(Component component, IHeaderResponse response) {
            response.render(JavaScriptReferenceHeaderItem.forReference(new PackageResourceReference(ServerTemplate.class, "singular.js")));
        }
    });
    destination.add($b.onReadyScript(() -> " Singular.atualizarContentWorklist(); "));
}
 
开发者ID:opensingular,项目名称:singular-server,代码行数:10,代码来源:DispatcherPage.java

示例14: renderHead

import org.apache.wicket.request.resource.PackageResourceReference; //导入依赖的package包/类
@Override
public void renderHead(IHeaderResponse response) {
    super.renderHead(response);
    response.render(CssHeaderItem.forUrl("/singular-static/resources/singular/fonts/google/open-sans.css"));
    response.render(JavaScriptReferenceHeaderItem.forReference(new PackageResourceReference(ServerTemplate.class, "singular.js")));
    response.render(CssHeaderItem.forReference(new PackageResourceReference(ServerTemplate.class, "ServerTemplate.css")));
    if (SingularProperties.get().isTrue(SingularProperties.ANALYTICS_ENABLED)) {
        response.render(JavaScriptHeaderItem.forUrl(skinnableResource("/layout4/scripts/analytics.js")));
    }
}
 
开发者ID:opensingular,项目名称:singular-server,代码行数:11,代码来源:ServerTemplate.java

示例15: mountImages

import org.apache.wicket.request.resource.PackageResourceReference; //导入依赖的package包/类
/**
 * Loads the images for the web application at start-up.
 */
private void mountImages() {
	final ResourceReference alignmentImage = new PackageResourceReference(ImageReference.class, "alignment.jpg");
	this.mountResource("/images/alignment", alignmentImage);

	final ResourceReference eventStreamImage = new PackageResourceReference(ImageReference.class, "eventStream.jpg");
	this.mountResource("/images/eventStream", eventStreamImage);

	final ResourceReference groupImage = new PackageResourceReference(ImageReference.class, "group.jpg");
	this.mountResource("/images/group", groupImage);

	final ResourceReference processImage = new PackageResourceReference(ImageReference.class, "process.jpg");
	this.mountResource("/images/process", processImage);
}
 
开发者ID:bptlab,项目名称:Unicorn,代码行数:17,代码来源:UNICORNApplication.java


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