当前位置: 首页>>代码示例>>Java>>正文


Java BooleanCallback.execute方法代码示例

本文整理汇总了Java中com.smartgwt.client.util.BooleanCallback.execute方法的典型用法代码示例。如果您正苦于以下问题:Java BooleanCallback.execute方法的具体用法?Java BooleanCallback.execute怎么用?Java BooleanCallback.execute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.smartgwt.client.util.BooleanCallback的用法示例。


在下文中一共展示了BooleanCallback.execute方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getRunIfValid

import com.smartgwt.client.util.BooleanCallback; //导入方法依赖的package包/类
private static BooleanCallback getRunIfValid(
        final Savable savable, final BooleanCallback saveCallback,
        final boolean ask, final BooleanCallback saveIfYes,
        final SaveValidation strategy, final ClientMessages i18n) {

    final BooleanCallback runOnValid = new BooleanCallback() {

        @Override
        public void execute(Boolean valid) {
            if (valid != null && valid) {
                if (ask) {
                    askSave(saveIfYes, i18n);
                } else {
                    savable.save(saveCallback);
                }
            } else if (strategy == SaveValidation.ASK) {
                askIgnoreValidation(saveIfYes, i18n);
            } else {
                saveCallback.execute(Boolean.FALSE);
            }
        }
    };
    return runOnValid;
}
 
开发者ID:proarc,项目名称:proarc,代码行数:25,代码来源:SaveAction.java

示例2: resetImportFolder

import com.smartgwt.client.util.BooleanCallback; //导入方法依赖的package包/类
private void resetImportFolder(final BatchRecord batch) {
    ImportBatchDataSource.State state = batch.getState();
    final BooleanCallback callback = new BooleanCallback() {

        @Override
        public void execute(Boolean value) {
            if (value != null && value) {
                handler.itemReset();
            }
        }
    };
    if (state == ImportBatchDataSource.State.INGESTING_FAILED) {
        callback.execute(true);
    } else {
        askForBatchReload(callback, batch);
    }
}
 
开发者ID:proarc,项目名称:proarc,代码行数:18,代码来源:ImportBatchChooser.java

示例3: save

import com.smartgwt.client.util.BooleanCallback; //导入方法依赖的package包/类
public void save(BooleanCallback callback) {
    callback = wrapSaveCallback(callback);
    if (activeEditor == modsCustomEditor) {
        saveCustomData(callback);
    } else if (activeEditor == modsBatchEditor) {
        saveBatchData(callback);
    } else if (activeEditor == catalogBrowser) {
        saveCatalogData(callback);
    } else if (activeEditor == modsSourceEditor) {
        saveXmlData(callback);
    } else {
        callback.execute(Boolean.TRUE);
    }
}
 
开发者ID:proarc,项目名称:proarc,代码行数:15,代码来源:ModsMultiEditor.java

示例4: wrapSaveCallback

import com.smartgwt.client.util.BooleanCallback; //导入方法依赖的package包/类
/**
 * Notifies other data sources to update its caches with object label.
 */
private BooleanCallback wrapSaveCallback(final BooleanCallback callback) {
    BooleanCallback bc = (Boolean value) -> {
        if (value != null && value) {
            RelationDataSource.getInstance().fireRelationChange(digitalObjects[0].getPid());
        }
        callback.execute(value);
    };
    return bc;
}
 
开发者ID:proarc,项目名称:proarc,代码行数:13,代码来源:ModsMultiEditor.java

示例5: handleFetch

import com.smartgwt.client.util.BooleanCallback; //导入方法依赖的package包/类
private void handleFetch(DSResponse response, DynamicForm editor, BooleanCallback loadCallback) {
    if (RestConfig.isStatusOk(response)) {
        Record[] data = response.getData();
        if (LOG.isLoggable(Level.FINE)) {
            ClientUtils.fine(LOG, "fetch custom data: %s", ClientUtils.dump(data));
        }
        if (data != null && data.length == 1) {
            Record customRecord = data[0];
            DescriptionMetadata dm = new DescriptionMetadata(customRecord);
            Record customModsRecord = dm.getDescription();
            if (customModsRecord != null) {
                metadata = dm;
                editor.editRecord(customModsRecord);
                editor.clearErrors(true);
                loadCallback.execute(Boolean.TRUE);
                fireEvent(new EditorLoadEvent(false));
                return ;
            }
        } else {
            String msg = data != null && data.length > 1
                    ? "Unexpected data in server response!"
                    : "No data in server response!";
            SC.warn(msg);
        }
    }
    widget.setMembers();
    loadCallback.execute(Boolean.FALSE);
    fireEvent(new EditorLoadEvent(true));
}
 
开发者ID:proarc,项目名称:proarc,代码行数:30,代码来源:ModsCustomEditor.java

示例6: saveImpl

import com.smartgwt.client.util.BooleanCallback; //导入方法依赖的package包/类
private void saveImpl(final BooleanCallback callback) {
    // do not use customForm.getValuesAsRecord()
    Record r = new Record(activeEditor.getValues());
    if (LOG.isLoggable(Level.FINE)) {
        ClientUtils.fine(LOG, "saveCustomData: %s", ClientUtils.dump(r.getJsObj()));
    }
    r = ClientUtils.normalizeData(r);
    metadata.setDescription(r);
    if (LOG.isLoggable(Level.FINE)) {
        ClientUtils.fine(LOG, "saveCustomRecord: %s", ClientUtils.dump(metadata.getWrapper().getJsObj()));
    }
    DescriptionSaveHandler dsh = new DescriptionSaveHandler() {

        @Override
        protected void onSave(DescriptionMetadata dm) {
            super.onSave(dm);
            if (dm != null) {
                metadata = dm;
                Record customModsRecord = dm.getDescription();
                if (customModsRecord != null) {
                    // refresh editor with server values
                    activeEditor.editRecord(customModsRecord);
                }
            }
            callback.execute(true);
            activeEditor.focus();
        }

        @Override
        protected void onConcurrencyError() {
            SC.ask(i18n.SaveAction_ConcurrentErrorAskReload_Msg(), new BooleanCallback() {

                @Override
                public void execute(Boolean value) {
                    callback.execute(false);
                    activeEditor.focus();
                    if (value != null && value) {
                        refresh();
                    }
                }
            });
        }

        @Override
        protected void onError() {
            super.onError();
            callback.execute(false);
        }

    };
    ModsCustomDataSource.getInstance().saveDescription(metadata, dsh, true);
}
 
开发者ID:proarc,项目名称:proarc,代码行数:53,代码来源:ModsCustomEditor.java

示例7: onHide

import com.smartgwt.client.util.BooleanCallback; //导入方法依赖的package包/类
public void onHide(BooleanCallback callback) {
    DigitalObjectCopyMetadataAction.resetSelection();
    callback.execute(true);
}
 
开发者ID:proarc,项目名称:proarc,代码行数:5,代码来源:ImportBatchItemEditor.java


注:本文中的com.smartgwt.client.util.BooleanCallback.execute方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。