本文整理汇总了Java中org.apache.wicket.Component.setVisibilityAllowed方法的典型用法代码示例。如果您正苦于以下问题:Java Component.setVisibilityAllowed方法的具体用法?Java Component.setVisibilityAllowed怎么用?Java Component.setVisibilityAllowed使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.wicket.Component
的用法示例。
在下文中一共展示了Component.setVisibilityAllowed方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onActiveIndexChange
import org.apache.wicket.Component; //导入方法依赖的package包/类
@SuppressWarnings("deprecation")
private void onActiveIndexChange(AjaxRequestTarget target) {
Component hitsContainer = blobsView.get(activeBlobIndex).get(HITS_ID);
if (!hitsContainer.isVisibilityAllowed()) {
hitsContainer.setVisibilityAllowed(true);
target.add(hitsContainer);
target.add(blobsView.get(activeBlobIndex).get(EXPAND_LINK_ID));
}
String activeLinkId = getMarkupId() + "-" + activeBlobIndex;
if (activeHitIndex != -1)
activeLinkId += "-" + activeHitIndex;
String script = String.format(""
+ "$('#%s').find('.selectable').removeClass('active');"
+ "$('#%s').addClass('active');"
+ "$('#%s>.search-result>.body').scrollIntoView('a.selectable.active', 25, 25);",
getMarkupId(), activeLinkId, getMarkupId());
target.appendJavaScript(script);
target.add(prevMatchLink);
target.add(nextMatchLink);
MatchedBlob activeBlob = blobs.get(activeBlobIndex);
QueryHit hit;
if (activeHitIndex != -1)
hit = activeBlob.getHits().get(activeHitIndex);
else
hit = new FileHit(activeBlob.getBlobPath(), null);
BlobIdent selected = new BlobIdent(context.getBlobIdent().revision, hit.getBlobPath(),
FileMode.REGULAR_FILE.getBits());
context.onSelect(target, selected, hit.getTokenPos());
}