Java Code Examples for org.apache.wicket.Component.setVisibilityAllowed()

The following are Jave code examples for showing how to use setVisibilityAllowed() of the org.apache.wicket.Component class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: gitplex-mit   File: SearchResultPanel.java   Source Code and License Vote up 5 votes
@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());
}