本文整理汇总了Java中org.apache.wicket.MarkupContainer.setVisible方法的典型用法代码示例。如果您正苦于以下问题:Java MarkupContainer.setVisible方法的具体用法?Java MarkupContainer.setVisible怎么用?Java MarkupContainer.setVisible使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.wicket.MarkupContainer
的用法示例。
在下文中一共展示了MarkupContainer.setVisible方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: AdvancedSearchOptionsPanel
import org.apache.wicket.MarkupContainer; //导入方法依赖的package包/类
public AdvancedSearchOptionsPanel(String id, IModel<QueryFacetsSelection> model) {
super(id, model);
optionsForm = new Form("options");
final CheckBox selectionType = new CheckBox("selectionType", new Model(filterQuerySelectionType));
selectionType.add(new OnChangeAjaxBehavior(){
@Override
protected void onUpdate(AjaxRequestTarget target) {
filterQuerySelectionType = !filterQuerySelectionType;
WebSession.get().setAttribute(SELECTION_TYPE_ATTRIBUTE_NAME, filterQuerySelectionType);
}
});
optionsForm.add(selectionType);
final CheckBox fcsCheck = createFieldNotEmptyOption("fcs", FacetConstants.FIELD_SEARCH_SERVICE);
optionsForm.add(fcsCheck);
final MarkupContainer collectionsSection = new WebMarkupContainer("collectionsSection");
final CheckBox collectionCheck = createFieldNotEmptyOption("collection", FacetConstants.FIELD_HAS_PART_COUNT);
collectionsSection.add(collectionCheck);
collectionsSection.setVisible(config.isProcessHierarchies());
optionsForm.add(collectionsSection);
optionsForm.add(indicatorAppender);
add(optionsForm);
}
示例2: onUpdate
import org.apache.wicket.MarkupContainer; //导入方法依赖的package包/类
@Override
protected void onUpdate(AjaxRequestTarget target) {
MarkupContainer pomEditorContainer = getPomEditorContainer();
pomEditorContainer.setVisible(!hasClassifier());
pomEditorContainer.get("deployPom").setVisible(!hasClassifier());
super.onUpdate(target);
}
示例3: setVisibility
import org.apache.wicket.MarkupContainer; //导入方法依赖的package包/类
private void setVisibility(MarkupContainer markup, boolean visible) {
markup.setEnabled(visible);
markup.setVisible(visible);
}
示例4: SearchResultItemPanel
import org.apache.wicket.MarkupContainer; //导入方法依赖的package包/类
/**
*
* @param id markup id of the panel
* @param documentModel model of document that this search item represents
* @param selectionModel model of current selection (will be passed on to
* record page when link is clicked)
* @param expansionStateModel model for the expansion state of this search
* item
* @param availabilityOrdering ordering for availability 'tags'
*/
public SearchResultItemPanel(String id, IModel<SolrDocument> documentModel, IModel<SearchContext> selectionModel, IModel<ExpansionState> expansionStateModel, Ordering<String> availabilityOrdering) {
super(id, documentModel);
this.expansionStateModel = expansionStateModel;
this.selectionModel = selectionModel;
this.documentModel = documentModel;
final Link recordLink = new RecordPageLink("recordLink", documentModel, selectionModel);
recordLink.add(new SolrFieldLabel("title", documentModel, FacetConstants.FIELD_NAME, "Unnamed record"));
add(recordLink);
// add a link to toggle the expansion state
add(createExpansionStateToggle("expansionStateToggle"));
// add a collapsed details panel; only shown when expansion state is collapsed (through onConfigure)
collapsedDetails = new SearchResultItemCollapsedPanel("collapsedDetails", documentModel, selectionModel, availabilityOrdering);
add(collapsedDetails);
// add a collapsed details panel; only shown when expansion state is expanded (through onConfigure)
expandedDetails = new SearchResultItemExpandedPanel("expandedDetails", documentModel, selectionModel, availabilityOrdering);
add(expandedDetails);
// get model for resources
final SolrFieldModel<String> resourcesModel = new SolrFieldModel<>(documentModel, FacetConstants.FIELD_RESOURCE);
// wrap with a count provider
final ResouceTypeCountDataProvider countProvider = new ResouceTypeCountDataProvider(resourcesModel, countingService);
// add a container for the resource type counts (only visible if there are actual resources)
add(new WebMarkupContainer("resources")
// view that shows provided counts
.add(new ResourceCountDataView("resourceCount", countProvider))
.add(new WebMarkupContainer("noResources") {
@Override
protected void onConfigure() {
super.onConfigure();
setVisible(countProvider.size() == 0);
}
}.add(new RecordPageLink("recordLink", documentModel, selectionModel)) //initial tab *not* resources as there are none...
)
);
add(new SearchResultItemLicensePanel("licenseInfo", documentModel, selectionModel, availabilityOrdering));
final MarkupContainer scoreContainer = new WebMarkupContainer("scoreContainer");
scoreContainer.add(new Label("score", new SolrFieldStringModel(documentModel, FacetConstants.FIELD_SOLR_SCORE)));
scoreContainer.setVisible(config.isShowResultScores());
add(scoreContainer);
setOutputMarkupId(true);
}
示例5: AddonsInfoPanel
import org.apache.wicket.MarkupContainer; //导入方法依赖的package包/类
/**
* Main constructor
*
* @param id ID to assign to panel
* @param installedAddons Name list of installed addons
* @param noEnabledAddons True if no addons are enabled
*/
public AddonsInfoPanel(String id, List<AddonInfo> installedAddons, boolean noEnabledAddons) {
super(id);
add(new CssClass("addons-table"));
final boolean currentLicenseValid = addonsManager.isLicenseInstalled();
MarkupContainer addonTable = new WebMarkupContainer("addonTable");
boolean noAddons = installedAddons.isEmpty();
boolean admin = authorizationService.isAdmin();
addonTable.setVisible(!noAddons);
addonTable.setOutputMarkupId(true);
Component listView = new ListView<AddonInfo>("addonItem", installedAddons) {
@Override
protected void populateItem(ListItem<AddonInfo> item) {
AddonInfo addonInfo = item.getModelObject();
item.add(new ExternalLink("name", getAddonUrl(addonInfo.getAddonName()),
addonInfo.getAddonDisplayName()));
item.add(new Label("image", "").add(new CssClass("addon-" + addonInfo.getAddonName())));
String stateString = getAddonStatus(addonInfo.getAddonState());
item.add(new Label("status", stateString));
if (item.getIndex() % 2 == 0) {
item.add(new CssClass("even"));
}
}
};
addonTable.add(listView);
add(addonTable);
add(new Label("addonsDisabled", "No addons available")
.setVisible(currentLicenseValid && !noAddons && noEnabledAddons));
add(new Label("noAddons", "No add-ons currently installed.").setVisible(noAddons));
String licenseRequiredMessage = addonsWebManager.getLicenseRequiredMessage(
WicketUtils.absoluteMountPathForPage(LicensePage.class));
Label noLicenseKeyLabel = new Label("noLicenseKey", licenseRequiredMessage);
noLicenseKeyLabel.setVisible(
admin && !currentLicenseValid && !noAddons && noEnabledAddons);
noLicenseKeyLabel.setEscapeModelStrings(false);
add(noLicenseKeyLabel);
}