本文整理匯總了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());
}