當前位置: 首頁>>代碼示例>>Java>>正文


Java PropertyModel類代碼示例

本文整理匯總了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);
}
 
開發者ID:Pardus-Engerek,項目名稱:engerek,代碼行數:23,代碼來源:ReconciliationPopupPanel.java

示例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);
}
 
開發者ID:bptlab,項目名稱:Unicorn,代碼行數:22,代碼來源:BasicTransformationRuleEditorPanel.java

示例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);
    }
 
開發者ID:Pardus-Engerek,項目名稱:engerek,代碼行數:26,代碼來源:UserReportConfigPanel.java

示例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);
}
 
開發者ID:Pardus-Engerek,項目名稱:engerek,代碼行數:26,代碼來源:DefaultHandlerPanel.java

示例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;
}
 
開發者ID:Pardus-Engerek,項目名稱:engerek,代碼行數:27,代碼來源:AssignmentDataTablePanel.java

示例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;

}
 
開發者ID:Pardus-Engerek,項目名稱:engerek,代碼行數:17,代碼來源:DateInput.java

示例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);
		}
	};

}
 
開發者ID:Pardus-Engerek,項目名稱:engerek,代碼行數:24,代碼來源:ColumnUtils.java

示例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));
}
 
開發者ID:acdh-oeaw,項目名稱:vlo-curation,代碼行數:26,代碼來源:AvailabilityFacetPanel.java

示例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;
}
 
開發者ID:acdh-oeaw,項目名稱:vlo-curation,代碼行數:20,代碼來源:SearchResultsHeaderPanel.java

示例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);
     }
 }
 
開發者ID:Pardus-Engerek,項目名稱:engerek,代碼行數:27,代碼來源:PrismContainerPanel.java

示例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;
}
 
開發者ID:acdh-oeaw,項目名稱:vlo-curation,代碼行數:23,代碼來源:FacetValuesPanel.java

示例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);
	}
 
開發者ID:bptlab,項目名稱:Unicorn,代碼行數:26,代碼來源:FilterExpressionPanel.java

示例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);
}
 
開發者ID:Pardus-Engerek,項目名稱:engerek,代碼行數:24,代碼來源:PageSelfRegistration.java

示例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);
    }
 
開發者ID:Pardus-Engerek,項目名稱:engerek,代碼行數:17,代碼來源:CapabilityValuePanel.java

示例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));
}
 
開發者ID:acdh-oeaw,項目名稱:vlo-curation,代碼行數:20,代碼來源:RecordNavigationPanel.java


注:本文中的org.apache.wicket.model.PropertyModel類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。