org.apache.wicket.request.resource.CssResourceReference Java Examples
The following examples show how to use
org.apache.wicket.request.resource.CssResourceReference.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: CodeEditorPanel.java From Orienteer with Apache License 2.0 | 6 votes |
private void setCustomEditorDependencies(IHeaderResponse response) { response.render(JavaScriptHeaderItem.forReference( new JavaScriptResourceReference(CodeEditorPanel.class, "editor.js"))); response.render(CssHeaderItem.forReference( new CssResourceReference(CodeEditorPanel.class, "editor.css"))); response.render(CssHeaderItem.forReference(CodeMirrorCss.CORE.getResourceReference())); response.render(JavaScriptHeaderItem.forReference(CodeMirrorJs.CORE.getResourceReference())); response.render(JavaScriptHeaderItem.forReference(CodeMirrorJs.ACTIVELINE_ADDON.getResourceReference())); addShowHintAddon(response); addActiveLine(response); addScrollbar(response); addFullscreenMode(response); addMatchBrackets(response); addAutoCloseBrackets(response); addEditorTheme(response); }
Example #2
Source File: SakaiPage.java From sakai with Educational Community License v2.0 | 6 votes |
@Override public void renderHead(IHeaderResponse response) { // get Sakai skin String skinRepo = serverConfigurationService.getString("skin.repo"); String skin = siteService.findTool(sessionManager.getCurrentToolSession().getPlacementId()).getSkin(); if (skin == null) { skin = serverConfigurationService.getString("skin.default"); } String toolCSS = skinRepo + "/" + skin + "/tool.css"; String toolBaseCSS = skinRepo + "/tool_base.css"; // Sakai additions response.render(JavaScriptUrlReferenceHeaderItem.forUrl("/library/js/headscripts.js")); response.render(CssUrlReferenceHeaderItem.forUrl(toolBaseCSS)); response.render(CssUrlReferenceHeaderItem.forUrl(toolCSS)); response.render(JavaScriptHeaderItem.forScript("\nif (typeof setMainFrameHeight !== 'undefined'){\n" + "setMainFrameHeight( window.name );\n" + "}", "iframe-resize")); // Tool additions (at end so we can override if required) response.render(new MetaDataHeaderItem(MetaDataHeaderItem.META_TAG).addTagAttribute("http-equiv", "Content-Type").addTagAttribute("content", "text/html; charset=UTF-8")); response.render(CssReferenceHeaderItem.forReference(new CssResourceReference(getClass(), "style.css"))); }
Example #3
Source File: SakaiPage.java From sakai with Educational Community License v2.0 | 6 votes |
@Override public void renderHead(IHeaderResponse response) { // get Sakai skin String skinRepo = serverConfigurationService.getString("skin.repo"); String skin = siteService.findTool(sessionManager.getCurrentToolSession().getPlacementId()).getSkin(); if (skin == null) { skin = serverConfigurationService.getString("skin.default"); } String toolCSS = skinRepo + "/" + skin + "/tool.css"; String toolBaseCSS = skinRepo + "/tool_base.css"; // Sakai additions response.render(JavaScriptUrlReferenceHeaderItem.forUrl("/library/js/headscripts.js")); response.render(CssUrlReferenceHeaderItem.forUrl(toolBaseCSS)); response.render(CssUrlReferenceHeaderItem.forUrl(toolCSS)); response.render(JavaScriptHeaderItem.forScript("\nif (typeof setMainFrameHeight !== 'undefined'){\n" + "setMainFrameHeight( window.name );\n" + "}", "iframe-resize")); // Tool additions (at end so we can override if required) response.render(new MetaDataHeaderItem(MetaDataHeaderItem.META_TAG).addTagAttribute("http-equiv", "Content-Type").addTagAttribute("content", "text/html; charset=UTF-8")); response.render(CssReferenceHeaderItem.forReference(new CssResourceReference(getClass(), "style.css"))); }
Example #4
Source File: Js4ResourceReferenceC.java From onedev with MIT License | 5 votes |
@Override public List<HeaderItem> getDependencies() { List<HeaderItem> dependencies = new ArrayList<>(); dependencies.add(JavaScriptHeaderItem.forReference(new Js3ResourceReferenceC())); dependencies.add(CssHeaderItem.forReference(new CssResourceReference(Js4ResourceReferenceC.class, "4.css"))); return dependencies; }
Example #5
Source File: CommitDetailResourceReference.java From onedev with MIT License | 5 votes |
@Override public List<HeaderItem> getDependencies() { List<HeaderItem> dependencies = super.getDependencies(); dependencies.add(JavaScriptHeaderItem.forReference(new OnelineResourceReference())); dependencies.add(CssHeaderItem.forReference(new CssResourceReference(CommitDetailResourceReference.class, "commit-detail.css"))); return dependencies; }
Example #6
Source File: SelectionPopoverResourceReference.java From onedev with MIT License | 5 votes |
@Override public List<HeaderItem> getDependencies() { List<HeaderItem> dependencies = new ArrayList<>(); dependencies.add(JavaScriptHeaderItem.forReference(Application.get().getJavaScriptLibrarySettings().getJQueryReference())); dependencies.add(CssHeaderItem.forReference(new CssResourceReference( SelectionPopoverResourceReference.class, "jquery.selectionpopover.css"))); return dependencies; }
Example #7
Source File: DropzoneResourceReference.java From onedev with MIT License | 5 votes |
@Override public List<HeaderItem> getDependencies() { List<HeaderItem> dependencies = new ArrayList<>(); dependencies.add(JavaScriptHeaderItem.forReference( Application.get().getJavaScriptLibrarySettings().getJQueryReference())); dependencies.add(CssHeaderItem.forReference( new CssResourceReference(DropzoneResourceReference.class, "dropzone.css"))); dependencies.add(OnDomReadyHeaderItem.forScript("Dropzone.autoDiscover = false;")); return dependencies; }
Example #8
Source File: JQueryUIResourceReference.java From onedev with MIT License | 5 votes |
@Override public List<HeaderItem> getDependencies() { List<HeaderItem> dependencies = new ArrayList<>(); dependencies.add(JavaScriptHeaderItem.forReference( Application.get().getJavaScriptLibrarySettings().getJQueryReference())); dependencies.add(JavaScriptHeaderItem.forReference(new JavaScriptResourceReference( JQueryUIResourceReference.class, "jquery-ui.min.js"))); dependencies.add(CssHeaderItem.forReference( new CssResourceReference(JQueryUIResourceReference.class, "jquery-ui.min.css"))); return dependencies; }
Example #9
Source File: SpectrumResourceReference.java From onedev with MIT License | 5 votes |
@Override public List<HeaderItem> getDependencies() { List<HeaderItem> dependencies = super.getDependencies(); dependencies.add(JavaScriptHeaderItem.forReference(Application.get().getJavaScriptLibrarySettings().getJQueryReference())); dependencies.add(CssHeaderItem.forReference(new CssResourceReference(SpectrumResourceReference.class, "spectrum.css"))); return dependencies; }
Example #10
Source File: AtWhoResourceReference.java From onedev with MIT License | 5 votes |
@Override public List<HeaderItem> getDependencies() { List<HeaderItem> dependencies = new ArrayList<>(); dependencies.add(JavaScriptHeaderItem.forReference(Application.get().getJavaScriptLibrarySettings().getJQueryReference())); dependencies.add(JavaScriptHeaderItem.forReference(new JavaScriptResourceReference( AtWhoResourceReference.class, "jquery.atwho-caret.js"))); dependencies.add(CssHeaderItem.forReference(new CssResourceReference( AtWhoResourceReference.class, "jquery.atwho.css"))); return dependencies; }
Example #11
Source File: PerfectScrollbarResourceReference.java From onedev with MIT License | 5 votes |
@Override public List<HeaderItem> getDependencies() { List<HeaderItem> dependencies = super.getDependencies(); dependencies.add(CssHeaderItem.forReference(new CssResourceReference( PerfectScrollbarResourceReference.class, "perfect-scrollbar.css"))); return dependencies; }
Example #12
Source File: ResourceBundleReferencesTest.java From onedev with MIT License | 5 votes |
@Test public void testc() { ResourceBundleReferences references = new ResourceBundleReferences(Js1ResourceReferenceC.class); Assert.assertEquals(2, references.getJavaScriptBundles().size()); Assert.assertEquals( Lists.newArrayList( JavaScriptReferenceHeaderItem.forReference(new Js3ResourceReferenceC()), JavaScriptReferenceHeaderItem.forReference(new Js4ResourceReferenceC())), references.getJavaScriptBundles().get(0).getProvidedResources()); Assert.assertEquals( Lists.newArrayList( JavaScriptReferenceHeaderItem.forReference(new Js1ResourceReferenceC()), JavaScriptReferenceHeaderItem.forReference(new Js2ResourceReferenceC())), references.getJavaScriptBundles().get(1).getProvidedResources()); Assert.assertEquals(2, references.getCssBundles().size()); Assert.assertEquals( Lists.newArrayList( CssReferenceHeaderItem.forReference(new CssResourceReference(Js3ResourceReferenceC.class, "3.css")), CssReferenceHeaderItem.forReference(new CssResourceReference(Js4ResourceReferenceC.class, "4.css"))), references.getCssBundles().get(0).getProvidedResources()); Assert.assertEquals( Lists.newArrayList( CssReferenceHeaderItem.forReference(new CssResourceReference(Js1ResourceReferenceC.class, "1.css")), CssReferenceHeaderItem.forReference(new CssResourceReference(Js2ResourceReferenceC.class, "2.css"))), references.getCssBundles().get(1).getProvidedResources()); }
Example #13
Source File: Js2ResourceReferenceC.java From onedev with MIT License | 5 votes |
@Override public List<HeaderItem> getDependencies() { List<HeaderItem> dependencies = new ArrayList<>(); dependencies.add(JavaScriptHeaderItem.forReference(new Js1ResourceReferenceC())); dependencies.add(CssHeaderItem.forReference(new CssResourceReference(Js2ResourceReferenceC.class, "2.css"))); return dependencies; }
Example #14
Source File: ProjectSelectorResourceReference.java From onedev with MIT License | 5 votes |
@Override public List<HeaderItem> getDependencies() { List<HeaderItem> dependencies = super.getDependencies(); dependencies.add(JavaScriptHeaderItem.forReference(new HotkeysResourceReference())); dependencies.add(JavaScriptHeaderItem.forReference(new ScrollIntoViewResourceReference())); dependencies.add(CssHeaderItem.forReference(new CssResourceReference(ProjectSelectorResourceReference.class, "project-selector.css"))); return dependencies; }
Example #15
Source File: Js3ResourceReferenceC.java From onedev with MIT License | 5 votes |
@Override public List<HeaderItem> getDependencies() { List<HeaderItem> dependencies = new ArrayList<>(); dependencies.add(JavaScriptHeaderItem.forReference(new Js1ResourceReferenceC())); dependencies.add(CssHeaderItem.forReference(new CssResourceReference(Js3ResourceReferenceC.class, "3.css"))); return dependencies; }
Example #16
Source File: AutoCompleteTextField.java From wicket-spring-boot with Apache License 2.0 | 5 votes |
@Override public void renderHead(final IHeaderResponse response) { super.renderHead(response); response.render(CssHeaderItem.forReference(new CssResourceReference( AutoCompleteTextField.class, "AutoCompleteTextField.css"))); }
Example #17
Source File: Homepage.java From spring-boot-example-wicket with Apache License 2.0 | 5 votes |
@Override public void renderHead(IHeaderResponse response) { super.renderHead(response); CssResourceReference cssResourceReference = new CssResourceReference( WicketWebApplication.class, "example.css"); response.render(CssHeaderItem.forReference(cssResourceReference)); }
Example #18
Source File: MountedPage.java From spring-boot-example-wicket with Apache License 2.0 | 5 votes |
@Override public void renderHead(IHeaderResponse response) { super.renderHead(response); CssResourceReference cssResourceReference = new CssResourceReference( WicketWebApplication.class, "example.css"); response.render(CssHeaderItem.forReference(cssResourceReference)); }
Example #19
Source File: FilterPanel.java From Orienteer with Apache License 2.0 | 5 votes |
@Override public void renderHead(IHeaderResponse response) { super.renderHead(response); response.render(JavaScriptHeaderItem.forReference( new JavaScriptResourceReference(FilterPanel.class, "filter.js"))); response.render(CssHeaderItem.forReference( new CssResourceReference(FilterPanel.class, "filter.css"))); response.render(OnDomReadyHeaderItem.forScript(initFilterJs(containerId, currentTab != null ? currentTab.getMarkupId() : null))); }
Example #20
Source File: BranchChoiceResourceReference.java From onedev with MIT License | 5 votes |
@Override public List<HeaderItem> getDependencies() { List<HeaderItem> dependencies = super.getDependencies(); dependencies.add(CssHeaderItem.forReference( new CssResourceReference(BranchChoiceResourceReference.class, "branch-choice.css"))); return dependencies; }
Example #21
Source File: ResourceBundleReferences.java From onedev with MIT License | 5 votes |
private void createBundles(Class<?> scope, Set<ResourceReference> resourceReferences) { /* * Some bundled css file may contain resources relative to parent paths of the css url, * for instance, a css may define below style: * * background: url(../images/clock.png)), * * if we use a resource name for instance "bundle" here, the generated resource * path will be something like "http://<server>:<port>/wicket/resource/org.apache.wicket.Application/bundle-ver-1472816165384.css", * and browser will resolve image url above as "http://<server>:<port>/wicket/resource/images/clock.png", which will cause Wicket * resource loading not working at all. However if we use a long path here for resource name, for instance * "a/l/o/n/g/p/a/t/h/bundle", the resolved image url will be "http://<server>:<port>/wicket/resource/org.apache.wicket.Application/a/l/o/n/g/p/a/t/clock.png", * which will be resolved to the correct image with help of our BundleAwareResourceReferenceFactory */ String name = "a/l/o/n/g/p/a/t/h/bundle"; List<ResourceReference> resourceReferenceList = new ArrayList<>(resourceReferences); resourceReferenceList.sort((o1, o2)->sorted.indexOf(o1)-sorted.indexOf(o2)); List<JavaScriptReferenceHeaderItem> javaScriptResourceReferences = new ArrayList<>(); List<CssReferenceHeaderItem> cssResourceReferences = new ArrayList<>(); for (ResourceReference resourceReference: resourceReferenceList) { if (resourceReference instanceof JavaScriptResourceReference) { javaScriptResourceReferences.add(JavaScriptReferenceHeaderItem.forReference(resourceReference)); } else if (resourceReference instanceof CssResourceReference) { cssResourceReferences.add(CssReferenceHeaderItem.forReference(resourceReference)); } } if (!javaScriptResourceReferences.isEmpty()) { javaScriptBundleReferences.add(new JavaScriptConcatResourceBundleReference( scope, name + ".js", javaScriptResourceReferences)); } if (!cssResourceReferences.isEmpty()) { cssBundleReferences.add(new CssConcatResourceBundleReference( scope, name + ".css", cssResourceReferences)); } }
Example #22
Source File: RevisionSelectorResourceReference.java From onedev with MIT License | 5 votes |
@Override public List<HeaderItem> getDependencies() { List<HeaderItem> dependencies = super.getDependencies(); dependencies.add(JavaScriptHeaderItem.forReference(new HotkeysResourceReference())); dependencies.add(CssHeaderItem.forReference(new CssResourceReference(RevisionSelectorResourceReference.class, "revision-selector.css"))); return dependencies; }
Example #23
Source File: MilestoneChoiceResourceReference.java From onedev with MIT License | 5 votes |
@Override public List<HeaderItem> getDependencies() { List<HeaderItem> dependencies = super.getDependencies(); dependencies.add(CssHeaderItem.forReference( new CssResourceReference(MilestoneChoiceResourceReference.class, "milestone-choice.css"))); return dependencies; }
Example #24
Source File: UserChoiceResourceReference.java From onedev with MIT License | 5 votes |
@Override public List<HeaderItem> getDependencies() { List<HeaderItem> dependencies = super.getDependencies(); dependencies.add(CssHeaderItem.forReference( new CssResourceReference(UserChoiceResourceReference.class, "user-choice.css"))); return dependencies; }
Example #25
Source File: Select2CssResourceReference.java From onedev with MIT License | 5 votes |
@Override public List<HeaderItem> getDependencies() { List<HeaderItem> dependencies = super.getDependencies(); dependencies.add(CssHeaderItem.forReference(new CssResourceReference( Select2CssResourceReference.class, "res/select2.css"))); return dependencies; }
Example #26
Source File: TextDiffResourceReference.java From onedev with MIT License | 5 votes |
@Override public List<HeaderItem> getDependencies() { List<HeaderItem> dependencies = super.getDependencies(); dependencies.add(JavaScriptHeaderItem.forReference(new HoverResourceReference())); dependencies.add(JavaScriptHeaderItem.forReference(new SelectionPopoverResourceReference())); dependencies.add(JavaScriptHeaderItem.forReference(new ClipboardResourceReference())); dependencies.add(JavaScriptHeaderItem.forReference(new ScrollIntoViewResourceReference())); dependencies.add(CssHeaderItem.forReference(new WebjarsCssResourceReference("codemirror/current/theme/eclipse.css"))); dependencies.add(CssHeaderItem.forReference(new CssResourceReference(TextDiffPanel.class, "text-diff.css"))); return dependencies; }
Example #27
Source File: ColorPickerResourceReference.java From onedev with MIT License | 5 votes |
@Override public List<HeaderItem> getDependencies() { List<HeaderItem> dependencies = super.getDependencies(); dependencies.add(JavaScriptHeaderItem.forReference(new SpectrumResourceReference())); dependencies.add(CssHeaderItem.forReference(new CssResourceReference(ColorPickerResourceReference.class, "color-picker.css"))); return dependencies; }
Example #28
Source File: FolderViewResourceReference.java From onedev with MIT License | 5 votes |
@Override public List<HeaderItem> getDependencies() { List<HeaderItem> dependencies = super.getDependencies(); dependencies.add(CssHeaderItem.forReference( new CssResourceReference(FolderViewResourceReference.class, "folder-view.css"))); // add this dependency as the lazy loaded last commits information includes avatar displaying dependencies.add(CssHeaderItem.forReference(new UserAvatarResourceReference())); dependencies.add(JavaScriptHeaderItem.forReference(new HoverResourceReference())); return dependencies; }
Example #29
Source File: BranchSelectorResourceReference.java From onedev with MIT License | 5 votes |
@Override public List<HeaderItem> getDependencies() { List<HeaderItem> dependencies = super.getDependencies(); dependencies.add(JavaScriptHeaderItem.forReference(new HotkeysResourceReference())); dependencies.add(CssHeaderItem.forReference( new CssResourceReference(BranchSelectorResourceReference.class, "branch-selector.css"))); return dependencies; }
Example #30
Source File: PullRequestChangesResourceReference.java From onedev with MIT License | 5 votes |
@Override public List<HeaderItem> getDependencies() { List<HeaderItem> dependencies = super.getDependencies(); dependencies.add(CssHeaderItem.forReference(new CssResourceReference( PullRequestChangesResourceReference.class, "pull-request-changes.css"))); return dependencies; }