本文整理汇总了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);
}
示例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;
}
}
示例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);
}
示例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);
}
示例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();
}
示例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();"));
}
}
示例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()));
}
示例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));
}
示例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;
}
}
示例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(":");
}
}
示例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")));
}
示例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() + ")"));
}
示例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(); "));
}
示例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")));
}
}
示例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);
}