本文整理匯總了Java中org.apache.wicket.model.PropertyModel類的典型用法代碼示例。如果您正苦於以下問題:Java PropertyModel類的具體用法?Java PropertyModel怎麽用?Java PropertyModel使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
PropertyModel類屬於org.apache.wicket.model包,在下文中一共展示了PropertyModel類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: initLayout
import org.apache.wicket.model.PropertyModel; //導入依賴的package包/類
private void initLayout(IModel<List<ResourceItemDto>> resources,
final Component component) {
TextFormGroup name = new TextFormGroup(ID_NAME, new PropertyModel<String>(getModel(), ReconciliationReportDto.F_NAME),
createStringResource("ObjectType.name"), ID_LABEL_SIZE, ID_INPUT_SIZE, true);
add(name);
TextFormGroup description = new TextFormGroup(ID_DESCRIPTION, new PropertyModel<String>(getModel(), ReconciliationReportDto.F_DESCRIPTION),
createStringResource("ObjectType.description"), ID_LABEL_SIZE, ID_INPUT_SIZE, true);
add(description);
IModel choices = WebComponentUtil.createReadonlyModelFromEnum(ExportType.class);
IChoiceRenderer renderer = new EnumChoiceRenderer();
DropDownFormGroup exportType = new DropDownFormGroup(ID_EXPORT_TYPE, new
PropertyModel<ExportType>(getModel(), ReconciliationReportDto.F_EXPORT_TYPE), choices, renderer,
createStringResource("ReconciliationPopupPanel.exportFileType"), ID_LABEL_SIZE, ID_INPUT_SIZE, false);
add(exportType);
DropDownFormGroup resourceDropDown = new DropDownFormGroup(ID_RESOURCE, createModel(resources.getObject()),
resources, renderer, createStringResource("ReconciliationPopupPanel.resource"), ID_LABEL_SIZE, ID_INPUT_SIZE, false);
add(resourceDropDown);
}
示例2: buildTextFields
import org.apache.wicket.model.PropertyModel; //導入依賴的package包/類
private void buildTextFields() {
this.transformationRuleNameTextField = new TextField<String>("transformationRuleNameTextField", new PropertyModel<String>(this, "transformationRuleName"));
this.transformationRuleNameTextField.setOutputMarkupId(true);
this.layoutForm.add(this.transformationRuleNameTextField);
final List<String> eventTypes = EapEventType.getAllTypeNames();
this.eventTypeDropDownChoice = new DropDownChoice<String>("eventTypeDropDownChoice", new PropertyModel<String>(this, "selectedEventTypeName"), eventTypes);
this.eventTypeDropDownChoice.add(new AjaxFormComponentUpdatingBehavior("onchange") {
private static final long serialVersionUID = 1L;
@Override
protected void onUpdate(final AjaxRequestTarget target) {
BasicTransformationRuleEditorPanel.this.updateOnChangeOfDropDownChoice(target);
}
});
this.layoutForm.add(this.eventTypeDropDownChoice);
this.transformationRuleTextArea = new TextArea<String>("transformationRuleTextArea", new PropertyModel<String>(this, "transformationRule"));
this.transformationRuleTextArea.setOutputMarkupId(true);
this.layoutForm.add(this.transformationRuleTextArea);
}
示例3: initLayout
import org.apache.wicket.model.PropertyModel; //導入依賴的package包/類
private void initLayout(final Component component){
TextFormGroup name = new TextFormGroup(ID_NAME, new PropertyModel<String>(getModel(), UserReportDto.F_NAME),
createStringResource("ObjectType.name"), ID_LABEL_SIZE, ID_INPUT_SIZE, true);
add(name);
TextFormGroup description = new TextFormGroup(ID_DESCRIPTION, new PropertyModel<String>(getModel(), UserReportDto.F_DESCRIPTION),
createStringResource("ObjectType.description"), ID_LABEL_SIZE, ID_INPUT_SIZE, true);
add(description);
IModel choices = WebComponentUtil.createReadonlyModelFromEnum(ExportType.class);
IChoiceRenderer renderer = new EnumChoiceRenderer();
DropDownFormGroup exportType = new DropDownFormGroup(ID_EXPORT_TYPE, new
PropertyModel<ExportType>(getModel(), UserReportDto.F_EXPORT_TYPE), choices, renderer,
createStringResource("UserReportConfigPanel.exportFileType"), ID_LABEL_SIZE, ID_INPUT_SIZE, false);
add(exportType);
DateFormGroup dateFrom = new DateFormGroup(ID_DATE_FROM, new PropertyModel<XMLGregorianCalendar>(getModel(), UserReportDto.F_FROM_GREG),
createStringResource("UserReportConfigPanel.dateFrom"), ID_LABEL_SIZE, ID_INPUT_SIZE, false);
add(dateFrom);
DateFormGroup dateTo = new DateFormGroup(ID_DATE_TO, new PropertyModel<XMLGregorianCalendar>(getModel(), UserReportDto.F_TO_GREG),
createStringResource("UserReportConfigPanel.dateTo"), ID_LABEL_SIZE, ID_INPUT_SIZE, false);
add(dateTo);
}
示例4: initLayout
import org.apache.wicket.model.PropertyModel; //導入依賴的package包/類
private void initLayout(final PageTaskEdit parentPage) {
WebMarkupContainer objectRefContainer = new WebMarkupContainer(ID_OBJECT_REF_CONTAINER);
objectRefContainer.add(new VisibleEnableBehaviour() {
@Override
public boolean isVisible() {
return getModelObject().getTaskDto().getObjectRef() != null;
}
});
final LinkPanel objectRef = new LinkPanel(ID_OBJECT_REF, new PropertyModel<String>(getModel(), HandlerDto.F_OBJECT_REF_NAME)) {
@Override
public void onClick(AjaxRequestTarget target) {
ObjectReferenceType ref = getModelObject().getObjectRef();
if (ref != null) {
WebComponentUtil.dispatchToObjectDetailsPage(ref, parentPage, false);
}
}
@Override
public boolean isEnabled() {
return WebComponentUtil.hasDetailsPage(getModelObject().getObjectRef());
}
};
objectRefContainer.add(objectRef);
add(objectRefContainer);
}
示例5: getChooseOrgPanel
import org.apache.wicket.model.PropertyModel; //導入依賴的package包/類
private ChooseTypePanel<OrgType> getChooseOrgPanel(String id, IModel<AssignmentEditorDto> model, ObjectQuery query){
ChooseTypePanel chooseOrgPanel = new ChooseTypePanel(id, new PropertyModel<ObjectViewDto>(model, AssignmentEditorDto.F_TENANT_REF)) {
private static final long serialVersionUID = 1L;
@Override
protected ObjectQuery getChooseQuery() {
return query;
}
@Override
public Class getObjectTypeClass(){
return OrgType.class;
}
@Override
protected boolean isSearchEnabled() {
return true;
}
@Override
protected QName getSearchProperty() {
return OrgType.F_NAME;
}
};
return chooseOrgPanel;
}
示例6: newDateTextField
import org.apache.wicket.model.PropertyModel; //導入依賴的package包/類
@Override
protected DateTextField newDateTextField(String id, PropertyModel dateFieldModel) {
String localizedDatePattern = WebComponentUtil.getLocalizedDatePattern(DateLabelComponent.SHORT_NOTIME_STYLE);
if (localizedDatePattern != null && !localizedDatePattern.contains("yyyy")){
localizedDatePattern = localizedDatePattern.replaceAll("yy", "yyyy");
}
DateTextField dateField = DateTextField.forDatePattern(id, dateFieldModel, localizedDatePattern);
dateField.add(new EmptyOnChangeAjaxFormUpdatingBehavior(){
@Override
protected void onUpdate(AjaxRequestTarget target){
DateInput.this.setModelObject(computeDateTime());
}
});
return dateField;
}
示例7: createPropertyColumn
import org.apache.wicket.model.PropertyModel; //導入依賴的package包/類
private static <T> PropertyColumn<T, String> createPropertyColumn(String name, String sortableProperty,
final String expression, final boolean multivalue) {
return new PropertyColumn<T, String>(createStringResource(name), sortableProperty, expression) {
private static final long serialVersionUID = 1L;
@Override
public void populateItem(Item item, String componentId, IModel rowModel) {
if (multivalue) {
IModel<List> values = new PropertyModel<List>(rowModel, expression);
RepeatingView repeater = new RepeatingView(componentId);
for (final Object task : values.getObject()) {
repeater.add(new Label(repeater.newChildId(), task.toString()));
}
item.add(repeater);
return;
}
super.populateItem(item, componentId, rowModel);
}
};
}
示例8: populateItem
import org.apache.wicket.model.PropertyModel; //導入依賴的package包/類
@Override
protected void populateItem(Item<Count> item) {
//model for actual value
final PropertyModel<String> valueModel = new PropertyModel<>(item.getModel(), "name");
//checkbox
final Component selector = createValueCheckbox("selector", valueModel.getObject());
item.add(selector);
//label
item.add(new WebMarkupContainer("label")
//child label
.add(new FieldValueLabel("name", valueModel, fieldNameModel))
//count label
.add(new Label("count", new PropertyModel<String>(item.getModel(), "count")))
//reference to checkbox
.add(new AttributeModifier("for", selector.getMarkupId()))
.add(new AttributeAppender("class", valueModel, " "))
);
//description as tooltip (title)
final IModel<FieldValueDescriptor> descriptorModel = new MapValueModel<>(descriptorsModel, valueModel);
final IModel<String> descriptionModel = new PropertyModel<>(descriptorModel, "description");
item.add(new AttributeModifier("title", descriptionModel));
}
示例9: createResultPageSizeForm
import org.apache.wicket.model.PropertyModel; //導入依賴的package包/類
private Form createResultPageSizeForm(String id, final IPageableItems resultsView) {
final Form resultPageSizeForm = new Form(id);
final DropDownChoice<Long> pageSizeDropDown
= new DropDownChoice<Long>("resultPageSize",
// bind to items per page property of pageable
new PropertyModel<Long>(resultsView, "itemsPerPage"),
ITEMS_PER_PAGE_OPTIONS);
pageSizeDropDown.add(new AjaxFormComponentUpdatingBehavior("change") {
@Override
protected void onUpdate(AjaxRequestTarget target) {
onChange(target);
}
});
resultPageSizeForm.add(pageSizeDropDown);
return resultPageSizeForm;
}
示例10: addOrReplaceProperties
import org.apache.wicket.model.PropertyModel; //導入依賴的package包/類
private void addOrReplaceProperties(IModel<ContainerWrapper> model, final Form form, boolean isToBeReplaced){
ListView<ItemWrapper> properties = new ListView<ItemWrapper>("properties",
new PropertyModel(model, "properties")) {
private static final long serialVersionUID = 1L;
@Override
protected void populateItem(final ListItem<ItemWrapper> item) {
item.add(new PrismPropertyPanel("property", item.getModel(), form, pageBase));
item.add(new VisibleEnableBehaviour() {
private static final long serialVersionUID = 1L;
@Override
public boolean isVisible() {
return item.getModel().getObject().isVisible();
}
});
item.add(AttributeModifier.append("class", createStyleClassModel(item.getModel())));
}
};
properties.setReuseItems(true);
if (isToBeReplaced) {
replace(properties);
} else {
add(properties);
}
}
示例11: createFilterForm
import org.apache.wicket.model.PropertyModel; //導入依賴的package包/類
/**
* Creates a form with an input bound to the filter model
*
* @param id component id
* @return filter form
*/
private Form createFilterForm(String id) {
final Form filterForm = new Form(id);
final TextField<String> filterField = new TextField<>("filterText",
new PropertyModel<String>(filterModel, "name"));
// make field update
filterField.add(new AjaxFormComponentUpdatingBehavior("keyup") {
@Override
protected void onUpdate(AjaxRequestTarget target) {
//update values
target.add(valuesContainer);
}
});
filterForm.add(filterField);
return filterForm;
}
示例12: buildFilterExpressionOperatorDropDownChoice
import org.apache.wicket.model.PropertyModel; //導入依賴的package包/類
private void buildFilterExpressionOperatorDropDownChoice() {
this.filterExpressionOperator = (FilterExpressionOperatorEnum) this.element.getValue();
final DropDownChoice<FilterExpressionOperatorEnum> filterExpressionOperatorDropDownChoice = new DropDownChoice<FilterExpressionOperatorEnum>("filterExpressionOperatorDropDownChoice", new PropertyModel<FilterExpressionOperatorEnum>(this, "filterExpressionOperator"), Arrays.asList(FilterExpressionOperatorEnum.values()), new ChoiceRenderer<FilterExpressionOperatorEnum>() {
private static final long serialVersionUID = 1L;
@Override
public Object getDisplayValue(final FilterExpressionOperatorEnum element) {
return element.getValue();
}
});
filterExpressionOperatorDropDownChoice.add(new AjaxFormComponentUpdatingBehavior("onchange") {
private static final long serialVersionUID = -5452061293278720695L;
@Override
protected void onUpdate(final AjaxRequestTarget target) {
FilterExpressionPanel.this.element.setValue(FilterExpressionPanel.this.filterExpressionOperator);
FilterExpressionPanel.this.table.getSelectedElements().remove(FilterExpressionPanel.this.element);
target.add(FilterExpressionPanel.this.table);
}
});
filterExpressionOperatorDropDownChoice.setOutputMarkupId(true);
this.layoutForm.add(filterExpressionOperatorDropDownChoice);
}
示例13: createPasswordPanel
import org.apache.wicket.model.PropertyModel; //導入依賴的package包/類
private void createPasswordPanel(WebMarkupContainer staticRegistrationForm) {
// ProtectedStringType initialPassword = null;
PasswordPanel password = new PasswordPanel(ID_PASSWORD,
new PropertyModel<ProtectedStringType>(userModel, "credentials.password.value"), false, true);
password.getBaseFormComponent().add(new EmptyOnBlurAjaxFormUpdatingBehaviour());
password.getBaseFormComponent().setRequired(true);
staticRegistrationForm.add(password);
Label help = new Label(ID_TOOLTIP);
final StringResourceModel tooltipText = createStringResource("PageSelfRegistration.password.policy");
help.add(AttributeModifier.replace("title", tooltipText));
help.add(new InfoTooltipBehavior());
help.add(new VisibleEnableBehaviour() {
private static final long serialVersionUID = 1L;
@Override
public boolean isVisible() {
return StringUtils.isNotEmpty(tooltipText.getObject());
}
});
staticRegistrationForm.add(help);
}
示例14: initLayout
import org.apache.wicket.model.PropertyModel; //導入依賴的package包/類
protected void initLayout(PageResourceWizard parentPage) {
parentPage.addEditingEnabledBehavior(this);
Label label = new Label(ID_LABEL, createStringResource(getCapabilityLabelKey()));
add(label);
CheckBox enabled = new CheckBox(ID_ENABLED, new PropertyModel<Boolean>(getModel(), "capability.enabled"));
enabled.add(new EmptyOnChangeAjaxFormUpdatingBehavior() {
@Override
protected void onUpdate(AjaxRequestTarget target) {
target.add(capabilityTable);
}
});
add(enabled);
}
示例15: RecordNavigationPanel
import org.apache.wicket.model.PropertyModel; //導入依賴的package包/類
public RecordNavigationPanel(String id, final IModel<SearchContext> model, IModel<String> tabModel) {
super(id, model);
// Add a label 'record X of Y'
add(new Label("recordIndex", StringResourceModelMigration.of("record.navigation.index", this, model,
new Object[]{
// These values get inserted into the string
// First: index shifted with +1 (because count starts at 0)
new ShiftedIndexModel(new PropertyModel<Long>(model, "index"), +1),
// Second: total result count, unmodified
new PropertyModel<>(model, "resultCount")
}
)));
// Add a link to go to the previous record
add(createPreviousLink(model, tabModel));
// Add a link to go to the next record
add(createNextLink(model, tabModel));
}