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


Java PropertyModel.getObject方法代碼示例

本文整理匯總了Java中org.apache.wicket.model.PropertyModel.getObject方法的典型用法代碼示例。如果您正苦於以下問題:Java PropertyModel.getObject方法的具體用法?Java PropertyModel.getObject怎麽用?Java PropertyModel.getObject使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.apache.wicket.model.PropertyModel的用法示例。


在下文中一共展示了PropertyModel.getObject方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: initLayout

import org.apache.wicket.model.PropertyModel; //導入方法依賴的package包/類
private void initLayout(final IModel<TaskDto> taskDtoModel, PageBase pageBase) {

		final PropertyModel<ModelOperationStatusDto> operationStatusModel = new PropertyModel<>(taskDtoModel, TaskDto.F_MODEL_OPERATION_STATUS);
		VisibleEnableBehaviour modelOpBehaviour = new VisibleEnableBehaviour() {
			@Override
			public boolean isVisible() {
				return operationStatusModel.getObject() != null;
			}
		};
		ModelOperationStatusPanel panel = new ModelOperationStatusPanel(ID_MODEL_OPERATION_STATUS_PANEL, operationStatusModel);
		panel.add(modelOpBehaviour);
		add(panel);
	}
 
開發者ID:Pardus-Engerek,項目名稱:engerek,代碼行數:14,代碼來源:TaskOperationTabPanel.java

示例2: initLayout

import org.apache.wicket.model.PropertyModel; //導入方法依賴的package包/類
private void initLayout(){
    WebMarkupContainer metadataBlock = new WebMarkupContainer(ID_METADATA_BLOCK);
    metadataBlock.setOutputMarkupId(true);
    add(metadataBlock);

    WebMarkupContainer headerContainer = new WebMarkupContainer(ID_HEADER_CONTAINER);
    headerContainer.setOutputMarkupId(true);
    headerContainer.add(new AttributeAppender("class", "prism-header " + additionalHeaderStyle));
    metadataBlock.add(headerContainer);

    Label metadataHeader = new Label(ID_METADATA_LABEL,
            createStringResource("AssignmentEditorPanel.metadataBlock", header != null ? header : ""));
    metadataHeader.setOutputMarkupId(true);
    headerContainer.add(metadataHeader);

    RepeatingView metadataRowRepeater = new RepeatingView(ID_METADATA_ROW);
    metadataBlock.add(metadataRowRepeater);
    for (QName qname : metadataFieldsList){
        WebMarkupContainer metadataRow = new WebMarkupContainer(metadataRowRepeater.newChildId());
        metadataRow.setOutputMarkupId(true);
        if (metadataFieldsList.indexOf(qname) % 2 != 0){
            metadataRow.add(new AttributeAppender("class", "stripe"));
        }
        metadataRowRepeater.add(metadataRow);

        metadataRow.add(new Label(ID_METADATA_PROPERTY_KEY, createStringResource(DOT_CLASS + qname.getLocalPart())));

        AbstractReadOnlyModel<String> metadataFieldModel = new AbstractReadOnlyModel<String>() {
            @Override
            public String getObject() {
                PropertyModel<Object> tempModel = new PropertyModel<Object>(getModel(),
                        qname.getLocalPart());
                if (tempModel.getObject() instanceof XMLGregorianCalendar){
                    return WebComponentUtil.getLocalizedDate((XMLGregorianCalendar)tempModel.getObject(),
                            DateLabelComponent.MEDIUM_MEDIUM_STYLE);
                } else if (tempModel.getObject() instanceof ObjectReferenceType){
                    ObjectReferenceType ref = (ObjectReferenceType) tempModel.getObject();
                    return WebComponentUtil.getName(ref, getPageBase(), OPERATION_LOAD_USER);
                } else if (tempModel.getObject() instanceof List){
                    List list = (List) tempModel.getObject();
                    String result = "";
                    for (Object o : list){
                        if (o instanceof  ObjectReferenceType){
                            if (result.length() > 0){
                                result += ", ";
                            }
                            result += WebComponentUtil.getName((ObjectReferenceType) o, getPageBase(), OPERATION_LOAD_USER);
                        }
                    }
                    return result;
                }
                return "";
            }
        };
        metadataRow.add(new Label(ID_METADATA_FILED, metadataFieldModel));
        metadataRow.add(new VisibleEnableBehaviour(){
            @Override
            public boolean isVisible(){
                return StringUtils.isNotEmpty(metadataFieldModel.getObject());
            }
        });

    }


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


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