本文整理汇总了Java中org.apache.wicket.markup.head.HeaderItem类的典型用法代码示例。如果您正苦于以下问题:Java HeaderItem类的具体用法?Java HeaderItem怎么用?Java HeaderItem使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
HeaderItem类属于org.apache.wicket.markup.head包,在下文中一共展示了HeaderItem类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getDependencies
import org.apache.wicket.markup.head.HeaderItem; //导入依赖的package包/类
@Override
public List<HeaderItem> getDependencies() {
List<HeaderItem> dependencies = super.getDependencies();
dependencies.add(JavaScriptHeaderItem.forReference(new JQueryUIResourceReference()));
dependencies.add(JavaScriptHeaderItem.forReference(new SelectionPopoverResourceReference()));
dependencies.add(JavaScriptHeaderItem.forReference(new HoverResourceReference()));
dependencies.add(JavaScriptHeaderItem.forReference(new ScrollIntoViewResourceReference()));
dependencies.add(JavaScriptHeaderItem.forReference(new DoneEventsResourceReference()));
dependencies.add(JavaScriptHeaderItem.forReference(new HotkeysResourceReference()));
dependencies.add(JavaScriptHeaderItem.forReference(new CookiesResourceReference()));
dependencies.add(JavaScriptHeaderItem.forReference(new CodeMirrorResourceReference()));
dependencies.add(JavaScriptHeaderItem.forReference(new ClipboardResourceReference()));
dependencies.add(CssHeaderItem.forReference(
new BaseDependentCssResourceReference(SourceViewResourceReference.class, "source-view.css")));
return dependencies;
}
示例2: createHeaderFilter
import org.apache.wicket.markup.head.HeaderItem; //导入依赖的package包/类
protected IHeaderResponseFilter createHeaderFilter(String headerFilterName, List<IHeaderResponseFilter> filters) {
return new IHeaderResponseFilter() {
@Override
public String getName() {
return headerFilterName;
}
@Override
public boolean accepts(HeaderItem item) {
boolean truth = true;
for (IHeaderResponseFilter filter : filters) {
if (!this.equals(filter)) {
truth &= !filter.accepts(item);
}
}
return truth;
}
};
}
示例3: renderHead
import org.apache.wicket.markup.head.HeaderItem; //导入依赖的package包/类
@Override
public void renderHead(final IHeaderResponse response) {
HeaderItem headerItem = null;
if (renderedShowing && showing) {
/*
* workaround for modal tags being copied by bootstrap-modal right into body and wicket updating the wrong
* tags in their previous position
*/
headerItem = OnDomReadyHeaderItem.forScript(createRefreshScript());
} else if (!renderedShowing && showing) {
headerItem = OnDomReadyHeaderItem.forScript(createShowScript());
renderedShowing = true;
} else if (renderedShowing && !showing) {
final StringBuilder script = new StringBuilder();
//scroll gets enabled again by registered hidden.bs.modal event from bootstrapModalConfig.js
script.append("$(window).disablescroll();");
script.append(createRefreshScript());
script.append(createHideScript());
headerItem = OnDomReadyHeaderItem.forScript(script);
renderedShowing = false;
}
renderDirectlyOrDelegateToRoot(response, headerItem);
alreadyRendered = true;
}
示例4: renderDirectlyOrDelegateToRoot
import org.apache.wicket.markup.head.HeaderItem; //导入依赖的package包/类
/**
* fix order of refresh to keep the hierarchy during show(); also only the root container should handle the render
* in inverse order
*/
private void renderDirectlyOrDelegateToRoot(final IHeaderResponse response, final HeaderItem headerItem) {
final ModalContainer rootModalContainer = Components.findComponent(ModalContainer.class, this.getPage());
//render directly if this is not a child of the root and thus the root was already rendered
if (rootModalContainer == this || rootModalContainer.alreadyRendered) {
if (headerItem != null) {
response.render(headerItem);
}
while (!rootRenderHeadQueue.isEmpty()) {
response.render(rootRenderHeadQueue.pop());
}
} else if (headerItem != null) {
//otherwise put the children into the queue to handle page refreshes in the correct order
rootModalContainer.rootRenderHeadQueue.push(headerItem);
}
}
示例5: getDependencies
import org.apache.wicket.markup.head.HeaderItem; //导入依赖的package包/类
@Override
public List<HeaderItem> getDependencies()
{
List<HeaderItem> dependencies = new ArrayList<>(super.getDependencies());
// CSS
dependencies.add(CssHeaderItem.forReference(BratCssVisReference.get()));
dependencies.add(CssHeaderItem.forReference(BratCssUiReference.get()));
// Libraries
dependencies.add(forReference(JQueryUILibrarySettings.get().getJavaScriptReference()));
dependencies.add(forReference(JQuerySvgResourceReference.get()));
dependencies.add(forReference(JQuerySvgDomResourceReference.get()));
dependencies.add(forReference(JQueryJsonResourceReference.get()));
dependencies.add(forReference(JQueryScrollbarWidthReference.get()));
// BRAT helpers
dependencies.add(forReference(BratConfigurationResourceReference.get()));
dependencies.add(forReference(BratUtilResourceReference.get()));
// BRAT modules
dependencies.add(forReference(BratDispatcherResourceReference.get()));
dependencies.add(forReference(BratAjaxResourceReference.get()));
return dependencies;
}
示例6: getDependencies
import org.apache.wicket.markup.head.HeaderItem; //导入依赖的package包/类
@Override
public List<HeaderItem> getDependencies() {
List<HeaderItem> dependencies = super.getDependencies();
dependencies.add(JavaScriptHeaderItem.forReference(new ScrollIntoViewResourceReference()));
dependencies.add(JavaScriptHeaderItem.forReference(new CaretResourceReference()));
dependencies.add(JavaScriptHeaderItem.forReference(new HotkeysResourceReference()));
dependencies.add(JavaScriptHeaderItem.forReference(new TextareaCaretPositionResourceReference()));
dependencies.add(CssHeaderItem.forReference(new BaseDependentCssResourceReference(
InputAssistResourceReference.class, "input-assist.css")));
return dependencies;
}
示例7: getDependencies
import org.apache.wicket.markup.head.HeaderItem; //导入依赖的package包/类
@Override
public List<HeaderItem> getDependencies() {
List<HeaderItem> dependencies = super.getDependencies();
dependencies.add(JavaScriptHeaderItem.forReference(new JQueryUIResourceReference()));
dependencies.add(CssHeaderItem.forReference(
new BaseDependentCssResourceReference(DragDropResourceReference.class, "dragdrop.css")));
return dependencies;
}
示例8: getDependencies
import org.apache.wicket.markup.head.HeaderItem; //导入依赖的package包/类
@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;
}
示例9: getDependencies
import org.apache.wicket.markup.head.HeaderItem; //导入依赖的package包/类
@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;
}
示例10: getDependencies
import org.apache.wicket.markup.head.HeaderItem; //导入依赖的package包/类
@Override
public List<HeaderItem> getDependencies() {
List<HeaderItem> dependencies = new ArrayList<>();
dependencies.add(JavaScriptHeaderItem.forReference(
Application.get().getJavaScriptLibrarySettings().getJQueryReference()));
dependencies.add(CssHeaderItem.forReference(
new CssResourceReference(JQueryUIResourceReference.class, "jquery-ui.min.css")));
return dependencies;
}
示例11: getDependencies
import org.apache.wicket.markup.head.HeaderItem; //导入依赖的package包/类
@Override
public List<HeaderItem> getDependencies() {
List<HeaderItem> dependencies = super.getDependencies();
WebjarsJavaScriptResourceReference metaReference = new WebjarsJavaScriptResourceReference("codemirror/current/mode/meta.js");
String modeBase = StringUtils.substringBeforeLast(RequestCycle.get().urlFor(metaReference, new PageParameters()).toString(), "/");
dependencies.add(OnDomReadyHeaderItem.forScript("CodeMirror.modeURL = '" + modeBase + "/%N/%N.js';"));
return dependencies;
}
示例12: getDependencies
import org.apache.wicket.markup.head.HeaderItem; //导入依赖的package包/类
@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;
}
示例13: getDependencies
import org.apache.wicket.markup.head.HeaderItem; //导入依赖的package包/类
@Override
public List<HeaderItem> getDependencies() {
List<HeaderItem> dependencies = new ArrayList<>();
dependencies.add(JavaScriptHeaderItem.forReference(
Application.get().getJavaScriptLibrarySettings().getJQueryReference()));
dependencies.add(JavaScriptHeaderItem.forReference(new TextareaCaretPositionResourceReference()));
return dependencies;
}
示例14: getDependencies
import org.apache.wicket.markup.head.HeaderItem; //导入依赖的package包/类
@Override
public List<HeaderItem> getDependencies() {
if (dependencies == null) {
synchronized (this) {
if (dependencies == null)
dependencies = super.getDependencies();
}
}
return dependencies;
}
示例15: getDependencyAware
import org.apache.wicket.markup.head.HeaderItem; //导入依赖的package包/类
private DependencyAware<ResourceReference> getDependencyAware(ResourceReference resource) {
return new DependencyAware<ResourceReference>() {
@Override
public ResourceReference getId() {
return resource;
}
@Override
public int hashCode() {
return getId().hashCode();
}
@SuppressWarnings("unchecked")
@Override
public boolean equals(Object obj) {
return getId().equals(((DependencyAware<ResourceReference>)obj).getId());
}
@Override
public Set<ResourceReference> getDependencies() {
Set<ResourceReference> dependencies = new LinkedHashSet<>();
for (HeaderItem item: resource.getDependencies()) {
if (item instanceof IReferenceHeaderItem) {
ResourceReference reference = ((IReferenceHeaderItem) item).getReference();
if (reference.canBeRegistered()) {
dependencies.add(reference);
}
}
}
return dependencies;
}
};
}