• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java BooleanCallback类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: getLogoutButton

import com.smartgwt.client.util.BooleanCallback; //导入依赖的package包/类
public ToolStripButton getLogoutButton(String login, final Controller controller) {
    ToolStripButton logoutButton = getSimpleToolStripButton(Images.instance.logout_30(), "Logout" + login);
    logoutButton.setIconOrientation("right");
    logoutButton.setTooltip("Logout");
    logoutButton.setBorder(GREY_BUTTON_BORDER);

    logoutButton.addClickHandler(new ClickHandler() {
        public void onClick(ClickEvent event) {
            SC.confirm("Logout", "Are you sure you want to exit?", new BooleanCallback() {
                public void execute(Boolean value) {
                    if (value) {
                        controller.logout();
                    }
                }
            });
        }
    });
    return logoutButton;
}
 
开发者ID:ow2-proactive,项目名称:scheduling-portal,代码行数:20,代码来源:ToolButtonsRender.java


示例2: saveImpl

import com.smartgwt.client.util.BooleanCallback; //导入依赖的package包/类
private void saveImpl(final BooleanCallback callback) {
    Record update = new Record(valuesManager.getValues());
    update = ClientUtils.normalizeData(update);
    updatingDevice = true;
    DeviceDataSource.getInstance().updateData(update, new DSCallback() {

        @Override
        public void execute(DSResponse response, Object rawData, DSRequest request) {
            updatingDevice = false;
            boolean status = RestConfig.isStatusOk(response);
            if (status) {
                StatusView.getInstance().show(i18n.SaveAction_Done_Msg());
                Record[] data = response.getData();
                if (data != null && data.length == 1) {
                    Record deviceRecord = data[0];
                    setDescription(deviceRecord);
                }
            }
            callback.execute(status);
        }
    });
}
 
开发者ID:proarc,项目名称:proarc,代码行数:23,代码来源:DeviceManager.java


示例3: saveImpl

import com.smartgwt.client.util.BooleanCallback; //导入依赖的package包/类
private void saveImpl(final BooleanCallback callback, String newXml) {
    ModsCustomDataSource.getInstance().saveXmlDescription(digitalObject, newXml, timestamp, new DescriptionSaveHandler() {

        @Override
        protected void onSave(DescriptionMetadata dm) {
            super.onSave(dm);
            refresh(false);
            callback.execute(Boolean.TRUE);
        }

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

        @Override
        protected void onValidationError() {
            // Do not ignore XML validation!
            SC.warn(i18n.SaveAction_Title(), getValidationMessage());
            callback.execute(Boolean.FALSE);
        }

    });
}
 
开发者ID:proarc,项目名称:proarc,代码行数:26,代码来源:ModsXmlEditor.java


示例4: saveCatalogData

import com.smartgwt.client.util.BooleanCallback; //导入依赖的package包/类
private void saveCatalogData(final BooleanCallback callback) {
    String mods = catalogBrowser.getMods();
    ModsCustomDataSource.getInstance().saveXmlDescription(digitalObjects[0], mods, new DescriptionSaveHandler() {

        @Override
        protected void onSave(DescriptionMetadata dm) {
            super.onSave(dm);
            callback.execute(Boolean.TRUE);
        }

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

    });
}
 
开发者ID:proarc,项目名称:proarc,代码行数:19,代码来源:ModsMultiEditor.java


示例5: ingest

import com.smartgwt.client.util.BooleanCallback; //导入依赖的package包/类
private void ingest(String batchId, String parentId, final BooleanCallback call) {
    ImportBatchDataSource dsBatch = ImportBatchDataSource.getInstance();
    DSRequest dsRequest = new DSRequest();
    dsRequest.setPromptStyle(PromptStyle.DIALOG);
    dsRequest.setPrompt(i18n.ImportWizard_UpdateItemsStep_Ingesting_Title());
    Record update = new Record();
    update.setAttribute(ImportBatchDataSource.FIELD_ID, batchId);
    update.setAttribute(ImportBatchDataSource.FIELD_PARENT, parentId);
    update.setAttribute(ImportBatchDataSource.FIELD_STATE, ImportBatchDataSource.State.INGESTING.name());
    dsBatch.updateData(update, new DSCallback() {

        @Override
        public void execute(DSResponse response, Object rawData, DSRequest request) {
            if (RestConfig.isStatusOk(response)) {
                Record[] records = response.getData();
                if (records != null && records.length > 0) {
                    importContext.setBatch(new BatchRecord(records[0]));
                    call.execute(true);
                    return;
                }
            }
            call.execute(false);
        }
    }, dsRequest);
}
 
开发者ID:proarc,项目名称:proarc,代码行数:26,代码来源:ImportPresenter.java


示例6: addChild

import com.smartgwt.client.util.BooleanCallback; //导入依赖的package包/类
public void addChild(String parentPid, String[] pid, final BooleanCallback call) {
    if (pid == null || pid.length < 1) {
        throw new IllegalArgumentException("Missing PID!");
    }
    if (parentPid == null || parentPid.isEmpty()) {
        throw new IllegalArgumentException("Missing parent PID!");
    }

    DSRequest dsRequest = new DSRequest();

    Record update = new Record();
    update.setAttribute(RelationDataSource.FIELD_PARENT, parentPid);
    update.setAttribute(RelationDataSource.FIELD_PID, pid);
    addData(update, new DSCallback() {

        @Override
        public void execute(DSResponse response, Object rawData, DSRequest request) {
            if (!RestConfig.isStatusOk(response)) {
                call.execute(false);
                return;
            }
            call.execute(true);
        }
    }, dsRequest);
}
 
开发者ID:proarc,项目名称:proarc,代码行数:26,代码来源:RelationDataSource.java


示例7: removeChild

import com.smartgwt.client.util.BooleanCallback; //导入依赖的package包/类
public void removeChild(String parentPid, String[] pid, final BooleanCallback call) {
    if (pid == null || pid.length < 1) {
        throw new IllegalArgumentException("Missing PID!");
    }
    if (parentPid == null || parentPid.isEmpty()) {
        throw new IllegalArgumentException("Missing parent PID!");
    }

    Record update = new Record();
    update.setAttribute(RelationDataSource.FIELD_PARENT, parentPid);
    update.setAttribute(RelationDataSource.FIELD_PID, pid);
    DSRequest dsRequest = new DSRequest();
    dsRequest.setData(update); // prevents removeData to drop other than primary key attributes
    removeData(update, new DSCallback() {

        @Override
        public void execute(DSResponse response, Object rawData, DSRequest request) {
            if (!RestConfig.isStatusOk(response)) {
                call.execute(false);
                return;
            }
            call.execute(true);
        }
    }, dsRequest);
}
 
开发者ID:proarc,项目名称:proarc,代码行数:26,代码来源:RelationDataSource.java


示例8: initOnStart

import com.smartgwt.client.util.BooleanCallback; //导入依赖的package包/类
public void initOnStart(final BooleanCallback callback) {
    if (cache == null) {
        cache = new ResultSet(this);
        cache.addDataArrivedHandler(new DataArrivedHandler() {

            @Override
            public void onDataArrived(DataArrivedEvent event) {
                if (cache.allRowsCached()) {
                    callback.execute(Boolean.TRUE);
                }
            }
        });
        cache.get(0);
    } else {
        cache.invalidateCache();
        cache.get(0);
    }
}
 
开发者ID:proarc,项目名称:proarc,代码行数:19,代码来源:ValueMapDataSource.java


示例9: saveTask

import com.smartgwt.client.util.BooleanCallback; //导入依赖的package包/类
/**
     * Saves savable object.
     *
<pre><code>
ask strategy    states
T   ASK         validate, (IfValidAsk, IfYesSave | IfNoDone) | (IfInvalidAsk, IfReallyYesSave | IfNoDone)
T   IGNORE      ask, (IfYesSave | IfNoDone)
T   RUN         validate, (IfValidAsk, IfYesSave | IfNoDone) | IfInvalidDone
F   ASK         validate, IfValidSave | (IfInvalidAsk, IfYesSave | IfNoDone)
F   IGNORE      save
F   RUN         validate, IfValidSave | IfInvalidDone
</code></pre>
     *
     * @param savable object implementing save
     * @param saveCallback listener to get save result
     * @param ask ask user before the save
     * @param strategy validation strategy
     */
    public static void saveTask(Savable savable, BooleanCallback saveCallback,
            boolean ask, SaveValidation strategy, ClientMessages i18n) {

        BooleanCallback saveIfYes = new SaveIfYes(savable, saveCallback);
        BooleanCallback runIfValid = getRunIfValid(savable, saveCallback, ask,
                saveIfYes, strategy, i18n);

        if (strategy == SaveValidation.IGNORE) {
            if (ask) {
                askSave(saveIfYes, i18n);
            } else {
                savable.save(saveCallback);
            }
        } else {
            savable.validate(runIfValid);
        }

    }
 
开发者ID:proarc,项目名称:proarc,代码行数:37,代码来源:SaveAction.java


示例10: 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


示例11: validateMods

import com.smartgwt.client.util.BooleanCallback; //导入依赖的package包/类
private void validateMods() {
    progress.setProgress(index, length);
    final Record record = digitalObjects[index];
    DigitalObject dobj = DigitalObject.create(record);
    validator.setShowFetchPrompt(false);
    validator.edit(dobj, new BooleanCallback() {

        @Override
        public void execute(Boolean value) {
            if (value != null && value) {
                consumeValidation(record, validator.isValidDigitalObject());
            } else {
                // unknown validity
            }
            ++index;
            // Scheduler is not necessary as fetch operations
            // run asynchronously
            ValidateTask.this.execute();
        }
    });
}
 
开发者ID:proarc,项目名称:proarc,代码行数:22,代码来源:DigitalObjectFormValidateAction.java


示例12: askForRegisterOptions

import com.smartgwt.client.util.BooleanCallback; //导入依赖的package包/类
private void askForRegisterOptions(String[] pids) {
    if (pids == null || pids.length == 0) {
        return ;
    }
    final Record register = new Record();
    register.setAttribute(DigitalObjectResourceApi.DIGITALOBJECT_PID, pids);
    SC.ask(i18n.UrnNbnAction_Window_Title(), i18n.UrnNbnAction_Window_Msg(),
            new BooleanCallback() {

        @Override
        public void execute(Boolean value) {
            if (value == Boolean.TRUE) {
                register(register);
            }
        }
    });
}
 
开发者ID:proarc,项目名称:proarc,代码行数:18,代码来源:UrnNbnAction.java


示例13: 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


示例14: save

import com.smartgwt.client.util.BooleanCallback; //导入依赖的package包/类
private void save() {
    if (originChildren == null) {
        return ;
    }
    Record[] rs = childrenListGrid.getOriginalResultSet().toArray();
    String[] childPids = ClientUtils.toFieldValues(rs, RelationDataSource.FIELD_PID);
    relationDataSource.reorderChildren(digitalObject, childPids, new BooleanCallback() {

        @Override
        public void execute(Boolean value) {
            if (value != null && value) {
                originChildren = null;
                updateReorderUi(false);
                StatusView.getInstance().show(i18n.SaveAction_Done_Msg());
            }
        }
    });
}
 
开发者ID:proarc,项目名称:proarc,代码行数:19,代码来源:DigitalObjectChildrenEditor.java


示例15: save

import com.smartgwt.client.util.BooleanCallback; //导入依赖的package包/类
public void save() {
    if (originChildren == null) {
        return ;
    }
    Record[] rs = getRecords();
    if (RelationDataSource.equals(originChildren, rs)) {
        updateWidgetsOnSave(sourceWidget);
        return ;
    }
    String[] childPids = ClientUtils.toFieldValues(rs, RelationDataSource.FIELD_PID);
    RelationDataSource relationDataSource = RelationDataSource.getInstance();
    DigitalObject root = DigitalObject.create(batchRecord);
    relationDataSource.reorderChildren(root, childPids, new BooleanCallback() {

        @Override
        public void execute(Boolean value) {
            if (value != null && value) {
                updateWidgetsOnSave(sourceWidget);
                StatusView.getInstance().show(i18n.SaveAction_Done_Msg());
            } else {
                updateWidgetsOnSave(null);
            }
        }
    });
}
 
开发者ID:proarc,项目名称:proarc,代码行数:26,代码来源:ImportBatchItemEditor.java


示例16: onParentSelection

import com.smartgwt.client.util.BooleanCallback; //导入依赖的package包/类
private void onParentSelection(final Record selection) {
    String parentOwner = selection.getAttribute(SearchDataSource.FIELD_OWNER);
    String username = Editor.getInstance().getUser().getAttribute(UserDataSource.FIELD_USERNAME);
    if (parentOwnerCheck && !username.equals(parentOwner)) {
        SC.ask(i18n.ImportParentChooser_SelectAction_ParentOwnerCheck_Msg(),
                new BooleanCallback() {

            @Override
            public void execute(Boolean value) {
                if (value != null && value) {
                    setParentSelection(selection);
                }
            }
        });
    } else {
        setParentSelection(selection);
    }
}
 
开发者ID:proarc,项目名称:proarc,代码行数:19,代码来源:ImportParentChooser.java


示例17: deleteRecord

import com.smartgwt.client.util.BooleanCallback; //导入依赖的package包/类
public void deleteRecord(final ListGridRecord record) {
	SC.ask("do you want to delete this item", new BooleanCallback() {

		@Override
		public void execute(Boolean value) {
			if (value) {
				GeneralItemsClient.getInstance().deleteGeneralItem(record.getAttributeAsLong(GameModel.GAMEID_FIELD), record.getAttributeAsLong(GeneralItemModel.GENERALITEMID_FIELD), new JsonCallback() {
					public void onJsonReceived(JSONValue jsonValue) {
						GeneralItemDataSource.getInstance().removeRecordWithKey(record.getAttributeAsLong(GeneralItemModel.GENERALITEMID_FIELD));
					}

				});
			}

		}
	});
}
 
开发者ID:WELTEN,项目名称:dojo-ibl,代码行数:18,代码来源:GeneralItemsTab.java


示例18: deleteItem

import com.smartgwt.client.util.BooleanCallback; //导入依赖的package包/类
@Override
protected void deleteItem(final ListGridRecord rollOverRecord) {
	SC.ask(constants.deleteThisRun().replace("***", rollOverRecord.getAttributeAsString(RunModel.RUNTITLE_FIELD)), new BooleanCallback() {
		public void execute(Boolean value) {
			if (value != null && value) {
				RunClient.getInstance().deleteItemsForRun(rollOverRecord.getAttributeAsLong("runId"), new JsonCallback() {
					
					@Override
					public void onJsonReceived(JSONValue jsonValue) {
						
						RunDataSource.getInstance().loadDataFromWeb();
	
					}
				});	
				
			}
		}
	});	
}
 
开发者ID:WELTEN,项目名称:dojo-ibl,代码行数:20,代码来源:RunsTab.java


示例19: createProfileButton

import com.smartgwt.client.util.BooleanCallback; //导入依赖的package包/类
private void createProfileButton() {
	profileButton = new ToolStripButton();  
	if (AccountManager.getInstance().getAccount()!= null) {
	profileButton.setIcon(AccountManager.getInstance().getAccount().getPicture());  
       profileButton.setTitle(AccountManager.getInstance().getAccount().getName());
	}
       loadButtons();
	profileButton.addClickHandler(new ClickHandler() {
		
		@Override
		public void onClick(ClickEvent event) {
			SC.ask("Logout?", new BooleanCallback() {
				
				@Override
				public void execute(Boolean value) {
					if (value) {
						OauthClient.disAuthenticate();
						Window.open("/oauth.html", "_self", "");
					}
					
				}
			});
			
		}
	});
}
 
开发者ID:WELTEN,项目名称:dojo-ibl,代码行数:27,代码来源:ToolBar.java


示例20: login

import com.smartgwt.client.util.BooleanCallback; //导入依赖的package包/类
/**
 * Execute a login attempt, given a user name and password. If a user has already logged in, a logout will be called
 * first.
 * 
 * @param userId
 *            The unique user ID.
 * @param password
 *            The user's password.
 * @param callback
 *            A possible callback to be executed when the login has been done (successfully or not). Can be null.
 */
public void login(final String userId, final String password, final BooleanCallback callback) {
	if (this.userId == null) {
		loginUser(userId, password, callback);
	} else if (this.userId.equals(userId)) {
		// Already logged in...
		return;
	} else {
		GwtCommand command = new GwtCommand(logoutCommandName);
		GwtCommandDispatcher.getInstance().execute(command, new AbstractCommandCallback<SuccessCommandResponse>() {

			public void execute(SuccessCommandResponse response) {
				if (response.isSuccess()) {
					userToken = null;
					Authentication.this.userId = null;
					manager.fireEvent(new LogoutSuccessEvent());
					loginUser(userId, password, callback);
				} else {
					manager.fireEvent(new LogoutFailureEvent());
				}
			}
		});
	}
}
 
开发者ID:geomajas,项目名称:geomajas-project-client-gwt,代码行数:35,代码来源:Authentication.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java RegistrationFailureUpcall类代码示例发布时间:2022-05-22
下一篇:
Java UtilAll类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap