本文整理汇总了Java中org.apache.wicket.markup.html.panel.Panel类的典型用法代码示例。如果您正苦于以下问题:Java Panel类的具体用法?Java Panel怎么用?Java Panel使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Panel类属于org.apache.wicket.markup.html.panel包,在下文中一共展示了Panel类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createSearchForm
import org.apache.wicket.markup.html.panel.Panel; //导入依赖的package包/类
private Panel createSearchForm(String id) {
final SearchFormPanel form = new SearchFormPanel(id, getModel()) {
@Override
protected void onSubmit(AjaxRequestTarget target) {
// reset expansion state of search results
searchResultsPanel.resetExpansion();
//transition from simple
if (simpleModeModel.getObject()) {
simpleModeModel.setObject(false);
if (target != null) {
target.prependJavaScript("cb|transitionFromSimple(cb);");
target.add(searchContainer); //update everything within container
}
}
updateSelection(target);
}
};
form.setOutputMarkupId(true);
return form;
}
示例2: addScenarioTabs
import org.apache.wicket.markup.html.panel.Panel; //导入依赖的package包/类
private void addScenarioTabs() {
tabs = new ArrayList<ITab>();
// tabs.add(new AbstractTab(new Model<String>("GET Scenario 3")) {
// @Override
// public Panel getPanel(final String panelId) {
// return new Scenario3Panel(panelId, panel);
// }
// });
final Map<String, List<ReplayFileBean>> fileBeans = ReplayerContainer.getFileBeans();
for (final String category : fileBeans.keySet()) {
tabs.add(new AbstractTab(new Model<String>(category)) {
@Override
public Panel getPanel(final String panelId) {
return new CategoryPanel(panelId, panel, category, fileBeans.get(category));
}
});
}
this.layoutForm.addOrReplace(new Collapsible("collapsible", tabs, Model.of(-1)));
}
示例3: getPanel
import org.apache.wicket.markup.html.panel.Panel; //导入依赖的package包/类
@Override
public WebMarkupContainer getPanel(final String containerId) {
final Object modelValue = panelModel.getObject();
final Panel panel = PanelFactory.get().getPanel(containerId, modelValue);
final Boolean behaviorAdded = panel.getMetaData(KEY_DISABLED_BEHAVIOR_ADDED);
if (behaviorAdded == null || !behaviorAdded) {
panel.setMetaData(KEY_DISABLED_BEHAVIOR_ADDED, true);
panel.add(new Behavior() {
@Override
public void onConfigure(final Component component) {
super.onConfigure(component);
component.setEnabled(ModelTab.this.isEnabled());
}
});
} else {
throw new IllegalStateException(
"KEY_DISABLED_BEHAVIOR_ADDED not expected, since panels are normally not cached!");
}
return panel;
}
示例4: process
import org.apache.wicket.markup.html.panel.Panel; //导入依赖的package包/类
@Override
public void process(final Component component) {
Assertions.assertThat(isShowing()).isFalse();
final Panel modalPanel = PanelFactory.get().getPanel(ModalContainer.PANEL_MARKUP_ID, modelObject);
if (modal == null) {
final HtmlContext parentContext = HtmlContext.get(component);
if (parentContext != null) {
modal = parentContext.getComponentRegistry().getComponent(ModalHtmlElement.WICKET_ID);
}
}
if (modal == null) {
modal = Components.findComponent(ModalContainer.class, component);
}
if (modal == null) {
//use root modal
modal = Components.findComponent(ModalContainer.class, component.getPage());
}
Assertions.assertThat(modal).as("No %s found in component hierarchy!", ModalContainer.class).isNotNull();
final IModel<String> title = getTitle(modalPanel);
modal.show(title, modalPanel, dimension);
}
示例5: getModuleSpecificTabbedPanel
import org.apache.wicket.markup.html.panel.Panel; //导入依赖的package包/类
/**
* Returns the module-specific tabbed panel to display
*
* @param forcedModule ID module to display instead of a one that might be specified in the parameters
* @return Module specific tabbed panel
*/
private Panel getModuleSpecificTabbedPanel(String forcedModule) {
String buildName = getBuildName();
String buildNumber = getBuildNumber();
String buildStarted = null;
String moduleId;
/**
* If the forced module is specified, it means that the user entered a request with a module id, but no build
* started parameter
*/
if (StringUtils.isNotBlank(forcedModule)) {
moduleId = forcedModule;
} else {
//Normal request from artifactory, containing all needed parameters
buildStarted = getStringParameter(BUILD_STARTED);
moduleId = getModuleId();
}
Build build = getBuild(buildName, buildNumber, buildStarted);
Module module = getModule(build, moduleId);
pageParameters.set(BUILD_STARTED, buildStarted);
pageParameters.set(MODULE_ID, moduleId);
return new BuildTabbedPanel(CHILD_PANEL_ID, build, module);
}
示例6: ViewFriends
import org.apache.wicket.markup.html.panel.Panel; //导入依赖的package包/类
public ViewFriends(final String userUuid) {
log.debug("ViewFriends()");
//get user viewing this page
final String currentUserUuid = sakaiProxy.getCurrentUserId();
//check person viewing this page (currentuserId) is allowed to view userId's friends - unless admin
if(!sakaiProxy.isSuperUser()){
boolean isFriendsListVisible = privacyLogic.isActionAllowed(userUuid, currentUserUuid, PrivacyType.PRIVACY_OPTION_MYFRIENDS);
if(!isFriendsListVisible) {
throw new ProfileFriendsIllegalAccessException("User: " + currentUserUuid + " is not allowed to view the friends list for: " + userUuid);
}
}
//show confirmed friends panel for the given user
Panel confirmedFriends = new ConfirmedFriends("confirmedFriends", userUuid);
confirmedFriends.setOutputMarkupId(true);
add(confirmedFriends);
//post view event
sakaiProxy.postEvent(ProfileConstants.EVENT_FRIENDS_VIEW_OTHER, "/profile/"+userUuid, false);
}
示例7: getLink
import org.apache.wicket.markup.html.panel.Panel; //导入依赖的package包/类
@Override
public AbstractLink getLink(String id) {
return new AjaxLink<Void>(id) {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget target) {
if (widget.hasSettings()) {
WidgetPanel widgetPanel = findParent(WidgetPanel.class);
Panel settingsPanel = widgetPanel.getSettingsPanel();
settingsPanel.setVisible(true);
target.add(settingsPanel);
}
}
};
}
示例8: buildTabList
import org.apache.wicket.markup.html.panel.Panel; //导入依赖的package包/类
private List<ITab> buildTabList() {
final List<ITab> tabs = new ArrayList<>();
for (final SchemaType schemaType : SchemaType.values()) {
tabs.add(new AbstractTab(new Model<>(schemaType.name())) {
private static final long serialVersionUID = 1037272333056449378L;
@Override
public Panel getPanel(final String panelId) {
return new SchemaTypePanel(panelId, schemaType, pageReference);
}
});
}
return tabs;
}
示例9: customResultBody
import org.apache.wicket.markup.html.panel.Panel; //导入依赖的package包/类
@Override
@SuppressWarnings("unchecked")
protected Panel customResultBody(final String panelId, final AnyWrapper<A> item, final Serializable result) {
if (!(result instanceof ProvisioningResult)) {
throw new IllegalStateException("Unsupported result type");
}
return new StatusPanel(
panelId,
((ProvisioningResult<A>) result).getEntity(),
new ListModel<>(new ArrayList<>()),
((ProvisioningResult<A>) result).getPropagationStatuses().stream().
map(input -> {
ConnObjectTO before = input.getBeforeObj();
ConnObjectWrapper afterObjWrapper = new ConnObjectWrapper(
((ProvisioningResult<A>) result).getEntity(),
input.getResource(),
input.getAfterObj());
return Pair.of(before, afterObjWrapper);
}).collect(Collectors.toList()),
pageRef);
}
示例10: getValuePanel
import org.apache.wicket.markup.html.panel.Panel; //导入依赖的package包/类
/**
* Get panel for attribute value (not remote status).
*
* @param id component id to be replaced with the fragment content.
* @param attrTO remote attribute.
* @return fragment.
*/
private Panel getValuePanel(final String id, final String schemaName, final AttrTO attrTO) {
Panel field;
if (attrTO == null) {
field = new AjaxTextFieldPanel(id, schemaName, new Model<>());
} else if (CollectionUtils.isEmpty(attrTO.getValues())) {
field = new AjaxTextFieldPanel(id, schemaName, new Model<>());
} else if (ConnIdSpecialName.PASSWORD.equals(schemaName)) {
field = new AjaxTextFieldPanel(id, schemaName, new Model<>("********"));
} else if (attrTO.getValues().size() == 1) {
field = new AjaxTextFieldPanel(id, schemaName, new Model<>(attrTO.getValues().get(0)));
} else {
field = new MultiFieldPanel.Builder<>(new ListModel<>(attrTO.getValues())).build(
id,
schemaName,
new AjaxTextFieldPanel("panel", schemaName, new Model<>()));
}
field.setEnabled(false);
return field;
}
示例11: Details
import org.apache.wicket.markup.html.panel.Panel; //导入依赖的package包/类
public Details(final RoleWrapper modelObject) {
add(new AjaxTextFieldPanel(
"key", "key", new PropertyModel<>(modelObject.getInnerObject(), "key"), false).
setEnabled(StringUtils.isEmpty(modelObject.getInnerObject().getKey())));
// ------------------------
// dynMembershipCond
// ------------------------
add(new Accordion("dynMembershipCond", Collections.<ITab>singletonList(
new AbstractTab(new ResourceModel("dynMembershipCond", "Dynamic USER Membership Conditions")) {
private static final long serialVersionUID = 1037272333056449378L;
@Override
public Panel getPanel(final String panelId) {
return new UserSearchPanel.Builder(
new PropertyModel<>(modelObject, "dynClauses")).
required(true).build(panelId);
}
}), Model.of(StringUtils.isBlank(modelObject.getDynMembershipCond()) ? -1 : 0)).setOutputMarkupId(true));
// ------------------------
}
示例12: addAction
import org.apache.wicket.markup.html.panel.Panel; //导入依赖的package包/类
/**
* Adds the given action. If the action is a panel, it is added as a child
* to this container.
*/
public ActionsColumn<T> addAction(DataTableAction<T> action) {
if (accessController == null) {
throw new RuntimeException("You must set the access controller on the data table before adding actions");
}
if (accessController.canAccess(action.getClass())) {
actions.add(action);
}
if (action instanceof Panel) {
dataTablePanel.addPanel((Panel) action);
}
return this;
}
示例13: executeAction
import org.apache.wicket.markup.html.panel.Panel; //导入依赖的package包/类
public void executeAction(AjaxRequestTarget target) {
Entity entity = getActionContext().getEntity();
try {
Report report = (Report) entity;
Panel workPanel;
if (ReportConstants.NEXT.equals(report.getType())) {
workPanel = new UploadNextReportPanel("work", report);
//setResponsePage(new UploadNextReportPage(report));
} else {
workPanel = new UploadJasperReportPanel("work", report);
//setResponsePage(new UploadJasperReportPage(report));
}
EntityBrowserPanel panel = findParent(EntityBrowserPanel.class);
panel.forwardWorkspace(workPanel, target);
} catch (Exception e) {
e.printStackTrace();
}
}
示例14: forwardWorkspace
import org.apache.wicket.markup.html.panel.Panel; //导入依赖的package包/类
public void forwardWorkspace(Panel panel, AjaxRequestTarget target) {
if (stack.size() > STACK_MAX_SIZE) {
// clear all
stack.pop();
while (stack.size() > 1) {
stack.pop();
}
}
panel.setOutputMarkupId(true);
workContainer.replace(panel);
stack.push(panel);
if (target != null) {
target.add(workContainer);
}
}
示例15: getPanel
import org.apache.wicket.markup.html.panel.Panel; //导入依赖的package包/类
public Panel getPanel(String panelId) {
if (type == GENERAL_SETTINGS) {
return new GeneralSettingsPanel("panel");
} else if (type == DISTRIBUTION_SETTINGS) {
return new DistributionSettingsPanel("panel");
} else if (type == JASPER_SETTINGS) {
return new JasperSettingsPanel("panel");
} else if (type == LOOK_SETTINGS) {
return new ChangeLogoPanel("panel");
} else if (type == SYNCHRONIZER_SETTINGS) {
return new SynchronizerSettingsPanel("panel");
} else if (type == THREAD_POOL_SETTINGS) {
return new SchedulerSettingsPanel("panel");
} else if (type == IFRAME_SETTINGS) {
return new IFrameSettingsPanel("panel");
} else if (type == INTEGRATION_SETTINGS) {
return new IntegrationSettingsPanel("panel");
} else if (type == HISTORY_SETTINGS) {
return new CleanHistorySettingsPanel("panel");
} else {
return new GeneralSettingsPanel("panel");
}
}