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


Java Dialog.CANCEL属性代码示例

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


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

示例1: openDbDriverLocationDialog

private int openDbDriverLocationDialog(String dbType, String driverName, String driverLocation) {
	DbDriverMetaData dbDriverMetaData = new DbDriverMetaData();
	dbDriverMetaData.setDbNmae(dbType);
	dbDriverMetaData.setDriverClassName(driverName);
	dbDriverMetaData.setDriverLocation(driverLocation);
	DbDriverLocationDialog dialog = new DbDriverLocationDialog("请先配置数据库驱动", getWorkbenchPart().getSite().getShell(), dbDriverMetaData);
	if (dialog.open() == Dialog.OK) {
		dbDriverMetaData.setDriverLocation(dialog.getDriverLocation());
		IPreferenceStore store = Activator.getDefault().getPreferenceStore();
		store.setValue(dbType, dialog.getDriverLocation());
		return attemptTestJdbcDriver(dbType, driverName, dbDriverMetaData.getDriverLocation());
	} else {
		return Dialog.CANCEL;
	}
}
 
开发者ID:bsteker,项目名称:bdf2,代码行数:15,代码来源:DatabaseAction.java

示例2: execute

@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
	IStructuredSelection selection = (IStructuredSelection) HandlerUtil.getCurrentSelection(event);
	BookmarkFolder bookmarkFolder = getSelectedBookmarkFolder(selection);
	if (bookmarkFolder == null) {
		return null;
	}
	Optional<String> fileId = bookmarkMappingsStore.getMapping(bookmarkFolder.getId()).map(mapping->mapping.getFileId());
	if (!fileId.isPresent()) {
		return null;
	}
	Shell shell = HandlerUtil.getActiveShell(event);
	Drive drive = gDriveConnectionManager.getDrive();
	if (drive == null) {
		return null;
	}
	ShareBookmarksFileDialog dialog = new ShareBookmarksFileDialog(shell);
	if (dialog.open() == Dialog.CANCEL) {
		return null;
	}
	ShareFileOperation shareFileOperation = new ShareFileOperation(drive);
	try {
		shareFileOperation.shareWithUser(fileId.get(), dialog.getEmail(), dialog.canWrite());
	} catch (IOException e) {
		throw new ExecutionException("Could not share bookmarks file with user", e);
	}
	return null;
}
 
开发者ID:cchabanois,项目名称:mesfavoris,代码行数:28,代码来源:ShareBookmarksFileHandler.java


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