Feedback 对象

WVCM Feedback 对象是用于在服务器交互期间从服务器请求其他反馈的结构。PropertyRequest 是一个 Feedback 实例。DetailedFeedback 是另一实例,它允许从一个服务器交互中的多个资源中检索特定属性。

几乎所有的 do 方法都接受 Feedback 参数。当操作执行时,将向 DetailedFeedback 对象传递包含了由 DetailedFeedback 对象请求的属性值的资源代理。 例如:
final ResourceList<Resource> modified = provider.resourceList();
    // Write properties from the current dialog tab
    // and fetch the properties for the "newTab"
    Feedback request = new DetailedFeedback() {
        public PropertyRequest getPropertyRequestForModified()
            {
                return DISPLAY_PROPERTIES_FOR_SIDE_EFFECTS;
            }
        public PropertyRequest getPropertyRequestForResult()
            {
                return computePropertiesNeededForTab(newTab);
            }
            public boolean isAbortRequested()
            {
                return false;
            }
            public void notifyActive(String message)
            {
            }
            public void notifyIsModified(Resource resource)
            {
                modified.add(record);
            }
            public void notifyPercentComplete(int percentComplete)
            {
            }
};
    CqRecord newTab = (CqRecord)record.doWriteProperties(request);

    // Update display to reflect side-effects of the operation
    RefreshDisplay(modified);
    if (isEmpty(record.updatedPropertyNameList())) {
        // All fields were written, so proceed to next tab...
        record = newTab;
        // setup the new tab...
    } else {
        // Report failures and stay on the old tab
    }

反馈